proteus  1.7.2
C/C++/Fortran libraries
BoundaryConditions.cpp
Go to the documentation of this file.
1 /* Generated by Cython 0.29.2 */
2 
3 #define PY_SSIZE_T_CLEAN
4 #include "Python.h"
5 #ifndef Py_PYTHON_H
6  #error Python headers needed to compile C extensions, please install development version of Python.
7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
8  #error Cython requires Python 2.6+ or Python 3.3+.
9 #else
10 #define CYTHON_ABI "0_29_2"
11 #define CYTHON_HEX_VERSION 0x001D02F0
12 #define CYTHON_FUTURE_DIVISION 0
13 #include <stddef.h>
14 #ifndef offsetof
15  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
16 #endif
17 #if !defined(WIN32) && !defined(MS_WINDOWS)
18  #ifndef __stdcall
19  #define __stdcall
20  #endif
21  #ifndef __cdecl
22  #define __cdecl
23  #endif
24  #ifndef __fastcall
25  #define __fastcall
26  #endif
27 #endif
28 #ifndef DL_IMPORT
29  #define DL_IMPORT(t) t
30 #endif
31 #ifndef DL_EXPORT
32  #define DL_EXPORT(t) t
33 #endif
34 #define __PYX_COMMA ,
35 #ifndef HAVE_LONG_LONG
36  #if PY_VERSION_HEX >= 0x02070000
37  #define HAVE_LONG_LONG
38  #endif
39 #endif
40 #ifndef PY_LONG_LONG
41  #define PY_LONG_LONG LONG_LONG
42 #endif
43 #ifndef Py_HUGE_VAL
44  #define Py_HUGE_VAL HUGE_VAL
45 #endif
46 #ifdef PYPY_VERSION
47  #define CYTHON_COMPILING_IN_PYPY 1
48  #define CYTHON_COMPILING_IN_PYSTON 0
49  #define CYTHON_COMPILING_IN_CPYTHON 0
50  #undef CYTHON_USE_TYPE_SLOTS
51  #define CYTHON_USE_TYPE_SLOTS 0
52  #undef CYTHON_USE_PYTYPE_LOOKUP
53  #define CYTHON_USE_PYTYPE_LOOKUP 0
54  #if PY_VERSION_HEX < 0x03050000
55  #undef CYTHON_USE_ASYNC_SLOTS
56  #define CYTHON_USE_ASYNC_SLOTS 0
57  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
58  #define CYTHON_USE_ASYNC_SLOTS 1
59  #endif
60  #undef CYTHON_USE_PYLIST_INTERNALS
61  #define CYTHON_USE_PYLIST_INTERNALS 0
62  #undef CYTHON_USE_UNICODE_INTERNALS
63  #define CYTHON_USE_UNICODE_INTERNALS 0
64  #undef CYTHON_USE_UNICODE_WRITER
65  #define CYTHON_USE_UNICODE_WRITER 0
66  #undef CYTHON_USE_PYLONG_INTERNALS
67  #define CYTHON_USE_PYLONG_INTERNALS 0
68  #undef CYTHON_AVOID_BORROWED_REFS
69  #define CYTHON_AVOID_BORROWED_REFS 1
70  #undef CYTHON_ASSUME_SAFE_MACROS
71  #define CYTHON_ASSUME_SAFE_MACROS 0
72  #undef CYTHON_UNPACK_METHODS
73  #define CYTHON_UNPACK_METHODS 0
74  #undef CYTHON_FAST_THREAD_STATE
75  #define CYTHON_FAST_THREAD_STATE 0
76  #undef CYTHON_FAST_PYCALL
77  #define CYTHON_FAST_PYCALL 0
78  #undef CYTHON_PEP489_MULTI_PHASE_INIT
79  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
80  #undef CYTHON_USE_TP_FINALIZE
81  #define CYTHON_USE_TP_FINALIZE 0
82  #undef CYTHON_USE_DICT_VERSIONS
83  #define CYTHON_USE_DICT_VERSIONS 0
84  #undef CYTHON_USE_EXC_INFO_STACK
85  #define CYTHON_USE_EXC_INFO_STACK 0
86 #elif defined(PYSTON_VERSION)
87  #define CYTHON_COMPILING_IN_PYPY 0
88  #define CYTHON_COMPILING_IN_PYSTON 1
89  #define CYTHON_COMPILING_IN_CPYTHON 0
90  #ifndef CYTHON_USE_TYPE_SLOTS
91  #define CYTHON_USE_TYPE_SLOTS 1
92  #endif
93  #undef CYTHON_USE_PYTYPE_LOOKUP
94  #define CYTHON_USE_PYTYPE_LOOKUP 0
95  #undef CYTHON_USE_ASYNC_SLOTS
96  #define CYTHON_USE_ASYNC_SLOTS 0
97  #undef CYTHON_USE_PYLIST_INTERNALS
98  #define CYTHON_USE_PYLIST_INTERNALS 0
99  #ifndef CYTHON_USE_UNICODE_INTERNALS
100  #define CYTHON_USE_UNICODE_INTERNALS 1
101  #endif
102  #undef CYTHON_USE_UNICODE_WRITER
103  #define CYTHON_USE_UNICODE_WRITER 0
104  #undef CYTHON_USE_PYLONG_INTERNALS
105  #define CYTHON_USE_PYLONG_INTERNALS 0
106  #ifndef CYTHON_AVOID_BORROWED_REFS
107  #define CYTHON_AVOID_BORROWED_REFS 0
108  #endif
109  #ifndef CYTHON_ASSUME_SAFE_MACROS
110  #define CYTHON_ASSUME_SAFE_MACROS 1
111  #endif
112  #ifndef CYTHON_UNPACK_METHODS
113  #define CYTHON_UNPACK_METHODS 1
114  #endif
115  #undef CYTHON_FAST_THREAD_STATE
116  #define CYTHON_FAST_THREAD_STATE 0
117  #undef CYTHON_FAST_PYCALL
118  #define CYTHON_FAST_PYCALL 0
119  #undef CYTHON_PEP489_MULTI_PHASE_INIT
120  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
121  #undef CYTHON_USE_TP_FINALIZE
122  #define CYTHON_USE_TP_FINALIZE 0
123  #undef CYTHON_USE_DICT_VERSIONS
124  #define CYTHON_USE_DICT_VERSIONS 0
125  #undef CYTHON_USE_EXC_INFO_STACK
126  #define CYTHON_USE_EXC_INFO_STACK 0
127 #else
128  #define CYTHON_COMPILING_IN_PYPY 0
129  #define CYTHON_COMPILING_IN_PYSTON 0
130  #define CYTHON_COMPILING_IN_CPYTHON 1
131  #ifndef CYTHON_USE_TYPE_SLOTS
132  #define CYTHON_USE_TYPE_SLOTS 1
133  #endif
134  #if PY_VERSION_HEX < 0x02070000
135  #undef CYTHON_USE_PYTYPE_LOOKUP
136  #define CYTHON_USE_PYTYPE_LOOKUP 0
137  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
138  #define CYTHON_USE_PYTYPE_LOOKUP 1
139  #endif
140  #if PY_MAJOR_VERSION < 3
141  #undef CYTHON_USE_ASYNC_SLOTS
142  #define CYTHON_USE_ASYNC_SLOTS 0
143  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
144  #define CYTHON_USE_ASYNC_SLOTS 1
145  #endif
146  #if PY_VERSION_HEX < 0x02070000
147  #undef CYTHON_USE_PYLONG_INTERNALS
148  #define CYTHON_USE_PYLONG_INTERNALS 0
149  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
150  #define CYTHON_USE_PYLONG_INTERNALS 1
151  #endif
152  #ifndef CYTHON_USE_PYLIST_INTERNALS
153  #define CYTHON_USE_PYLIST_INTERNALS 1
154  #endif
155  #ifndef CYTHON_USE_UNICODE_INTERNALS
156  #define CYTHON_USE_UNICODE_INTERNALS 1
157  #endif
158  #if PY_VERSION_HEX < 0x030300F0
159  #undef CYTHON_USE_UNICODE_WRITER
160  #define CYTHON_USE_UNICODE_WRITER 0
161  #elif !defined(CYTHON_USE_UNICODE_WRITER)
162  #define CYTHON_USE_UNICODE_WRITER 1
163  #endif
164  #ifndef CYTHON_AVOID_BORROWED_REFS
165  #define CYTHON_AVOID_BORROWED_REFS 0
166  #endif
167  #ifndef CYTHON_ASSUME_SAFE_MACROS
168  #define CYTHON_ASSUME_SAFE_MACROS 1
169  #endif
170  #ifndef CYTHON_UNPACK_METHODS
171  #define CYTHON_UNPACK_METHODS 1
172  #endif
173  #ifndef CYTHON_FAST_THREAD_STATE
174  #define CYTHON_FAST_THREAD_STATE 1
175  #endif
176  #ifndef CYTHON_FAST_PYCALL
177  #define CYTHON_FAST_PYCALL 1
178  #endif
179  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
180  #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
181  #endif
182  #ifndef CYTHON_USE_TP_FINALIZE
183  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
184  #endif
185  #ifndef CYTHON_USE_DICT_VERSIONS
186  #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
187  #endif
188  #ifndef CYTHON_USE_EXC_INFO_STACK
189  #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
190  #endif
191 #endif
192 #if !defined(CYTHON_FAST_PYCCALL)
193 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
194 #endif
195 #if CYTHON_USE_PYLONG_INTERNALS
196  #include "longintrepr.h"
197  #undef SHIFT
198  #undef BASE
199  #undef MASK
200  #ifdef SIZEOF_VOID_P
201  enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
202  #endif
203 #endif
204 #ifndef __has_attribute
205  #define __has_attribute(x) 0
206 #endif
207 #ifndef __has_cpp_attribute
208  #define __has_cpp_attribute(x) 0
209 #endif
210 #ifndef CYTHON_RESTRICT
211  #if defined(__GNUC__)
212  #define CYTHON_RESTRICT __restrict__
213  #elif defined(_MSC_VER) && _MSC_VER >= 1400
214  #define CYTHON_RESTRICT __restrict
215  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
216  #define CYTHON_RESTRICT restrict
217  #else
218  #define CYTHON_RESTRICT
219  #endif
220 #endif
221 #ifndef CYTHON_UNUSED
222 # if defined(__GNUC__)
223 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
224 # define CYTHON_UNUSED __attribute__ ((__unused__))
225 # else
226 # define CYTHON_UNUSED
227 # endif
228 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
229 # define CYTHON_UNUSED __attribute__ ((__unused__))
230 # else
231 # define CYTHON_UNUSED
232 # endif
233 #endif
234 #ifndef CYTHON_MAYBE_UNUSED_VAR
235 # if defined(__cplusplus)
236  template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
237 # else
238 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
239 # endif
240 #endif
241 #ifndef CYTHON_NCP_UNUSED
242 # if CYTHON_COMPILING_IN_CPYTHON
243 # define CYTHON_NCP_UNUSED
244 # else
245 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
246 # endif
247 #endif
248 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
249 #ifdef _MSC_VER
250  #ifndef _MSC_STDINT_H_
251  #if _MSC_VER < 1300
252  typedef unsigned char uint8_t;
253  typedef unsigned int uint32_t;
254  #else
255  typedef unsigned __int8 uint8_t;
256  typedef unsigned __int32 uint32_t;
257  #endif
258  #endif
259 #else
260  #include <stdint.h>
261 #endif
262 #ifndef CYTHON_FALLTHROUGH
263  #if defined(__cplusplus) && __cplusplus >= 201103L
264  #if __has_cpp_attribute(fallthrough)
265  #define CYTHON_FALLTHROUGH [[fallthrough]]
266  #elif __has_cpp_attribute(clang::fallthrough)
267  #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
268  #elif __has_cpp_attribute(gnu::fallthrough)
269  #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
270  #endif
271  #endif
272  #ifndef CYTHON_FALLTHROUGH
273  #if __has_attribute(fallthrough)
274  #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
275  #else
276  #define CYTHON_FALLTHROUGH
277  #endif
278  #endif
279  #if defined(__clang__ ) && defined(__apple_build_version__)
280  #if __apple_build_version__ < 7000000
281  #undef CYTHON_FALLTHROUGH
282  #define CYTHON_FALLTHROUGH
283  #endif
284  #endif
285 #endif
286 
287 #ifndef __cplusplus
288  #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
289 #endif
290 #ifndef CYTHON_INLINE
291  #if defined(__clang__)
292  #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
293  #else
294  #define CYTHON_INLINE inline
295  #endif
296 #endif
297 template<typename T>
298 void __Pyx_call_destructor(T& x) {
299  x.~T();
300 }
301 template<typename T>
302 class __Pyx_FakeReference {
303  public:
304  __Pyx_FakeReference() : ptr(NULL) { }
305  __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
306  T *operator->() { return ptr; }
307  T *operator&() { return ptr; }
308  operator T&() { return *ptr; }
309  template<typename U> bool operator ==(U other) { return *ptr == other; }
310  template<typename U> bool operator !=(U other) { return *ptr != other; }
311  private:
312  T *ptr;
313 };
314 
315 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
316  #define Py_OptimizeFlag 0
317 #endif
318 #define __PYX_BUILD_PY_SSIZE_T "n"
319 #define CYTHON_FORMAT_SSIZE_T "z"
320 #if PY_MAJOR_VERSION < 3
321  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
322  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
323  PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
324  #define __Pyx_DefaultClassType PyClass_Type
325 #else
326  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
327  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
328  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
329  #define __Pyx_DefaultClassType PyType_Type
330 #endif
331 #ifndef Py_TPFLAGS_CHECKTYPES
332  #define Py_TPFLAGS_CHECKTYPES 0
333 #endif
334 #ifndef Py_TPFLAGS_HAVE_INDEX
335  #define Py_TPFLAGS_HAVE_INDEX 0
336 #endif
337 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
338  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
339 #endif
340 #ifndef Py_TPFLAGS_HAVE_FINALIZE
341  #define Py_TPFLAGS_HAVE_FINALIZE 0
342 #endif
343 #ifndef METH_STACKLESS
344  #define METH_STACKLESS 0
345 #endif
346 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
347  #ifndef METH_FASTCALL
348  #define METH_FASTCALL 0x80
349  #endif
350  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
351  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
352  Py_ssize_t nargs, PyObject *kwnames);
353 #else
354  #define __Pyx_PyCFunctionFast _PyCFunctionFast
355  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
356 #endif
357 #if CYTHON_FAST_PYCCALL
358 #define __Pyx_PyFastCFunction_Check(func)\
359  ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
360 #else
361 #define __Pyx_PyFastCFunction_Check(func) 0
362 #endif
363 #if CYTHON_USE_DICT_VERSIONS
364 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
365 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
366  (version_var) = __PYX_GET_DICT_VERSION(dict);\
367  (cache_var) = (value);
368 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
369  static PY_UINT64_T __pyx_dict_version = 0;\
370  static PyObject *__pyx_dict_cached_value = NULL;\
371  if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
372  (VAR) = __pyx_dict_cached_value;\
373  } else {\
374  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
375  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
376  }\
377  }
378 #else
379 #define __PYX_GET_DICT_VERSION(dict) (0)
380 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
381 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
382 #endif
383 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
384  #define PyObject_Malloc(s) PyMem_Malloc(s)
385  #define PyObject_Free(p) PyMem_Free(p)
386  #define PyObject_Realloc(p) PyMem_Realloc(p)
387 #endif
388 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
389  #define PyMem_RawMalloc(n) PyMem_Malloc(n)
390  #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
391  #define PyMem_RawFree(p) PyMem_Free(p)
392 #endif
393 #if CYTHON_COMPILING_IN_PYSTON
394  #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
395  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
396 #else
397  #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
398  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
399 #endif
400 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
401  #define __Pyx_PyThreadState_Current PyThreadState_GET()
402 #elif PY_VERSION_HEX >= 0x03060000
403  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
404 #elif PY_VERSION_HEX >= 0x03000000
405  #define __Pyx_PyThreadState_Current PyThreadState_GET()
406 #else
407  #define __Pyx_PyThreadState_Current _PyThreadState_Current
408 #endif
409 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
410 #include "pythread.h"
411 #define Py_tss_NEEDS_INIT 0
412 typedef int Py_tss_t;
413 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
414  *key = PyThread_create_key();
415  return 0; // PyThread_create_key reports success always
416 }
417 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
418  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
419  *key = Py_tss_NEEDS_INIT;
420  return key;
421 }
422 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
423  PyObject_Free(key);
424 }
425 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
426  return *key != Py_tss_NEEDS_INIT;
427 }
428 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
429  PyThread_delete_key(*key);
430  *key = Py_tss_NEEDS_INIT;
431 }
432 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
433  return PyThread_set_key_value(*key, value);
434 }
435 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
436  return PyThread_get_key_value(*key);
437 }
438 #endif // TSS (Thread Specific Storage) API
439 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
440 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
441 #else
442 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
443 #endif
444 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
445  #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
446  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
447 #else
448  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
449  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
450 #endif
451 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
452 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
453 #else
454 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
455 #endif
456 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
457  #define CYTHON_PEP393_ENABLED 1
458  #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
459  0 : _PyUnicode_Ready((PyObject *)(op)))
460  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
461  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
462  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
463  #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
464  #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
465  #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
466  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
467  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
468 #else
469  #define CYTHON_PEP393_ENABLED 0
470  #define PyUnicode_1BYTE_KIND 1
471  #define PyUnicode_2BYTE_KIND 2
472  #define PyUnicode_4BYTE_KIND 4
473  #define __Pyx_PyUnicode_READY(op) (0)
474  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
475  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
476  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
477  #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
478  #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
479  #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
480  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
481  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
482 #endif
483 #if CYTHON_COMPILING_IN_PYPY
484  #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
485  #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
486 #else
487  #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
488  #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
489  PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
490 #endif
491 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
492  #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
493 #endif
494 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
495  #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
496 #endif
497 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
498  #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
499 #endif
500 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
501 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
502 #if PY_MAJOR_VERSION >= 3
503  #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
504 #else
505  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
506 #endif
507 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
508  #define PyObject_ASCII(o) PyObject_Repr(o)
509 #endif
510 #if PY_MAJOR_VERSION >= 3
511  #define PyBaseString_Type PyUnicode_Type
512  #define PyStringObject PyUnicodeObject
513  #define PyString_Type PyUnicode_Type
514  #define PyString_Check PyUnicode_Check
515  #define PyString_CheckExact PyUnicode_CheckExact
516  #define PyObject_Unicode PyObject_Str
517 #endif
518 #if PY_MAJOR_VERSION >= 3
519  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
520  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
521 #else
522  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
523  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
524 #endif
525 #ifndef PySet_CheckExact
526  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
527 #endif
528 #if CYTHON_ASSUME_SAFE_MACROS
529  #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
530 #else
531  #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
532 #endif
533 #if PY_MAJOR_VERSION >= 3
534  #define PyIntObject PyLongObject
535  #define PyInt_Type PyLong_Type
536  #define PyInt_Check(op) PyLong_Check(op)
537  #define PyInt_CheckExact(op) PyLong_CheckExact(op)
538  #define PyInt_FromString PyLong_FromString
539  #define PyInt_FromUnicode PyLong_FromUnicode
540  #define PyInt_FromLong PyLong_FromLong
541  #define PyInt_FromSize_t PyLong_FromSize_t
542  #define PyInt_FromSsize_t PyLong_FromSsize_t
543  #define PyInt_AsLong PyLong_AsLong
544  #define PyInt_AS_LONG PyLong_AS_LONG
545  #define PyInt_AsSsize_t PyLong_AsSsize_t
546  #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
547  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
548  #define PyNumber_Int PyNumber_Long
549 #endif
550 #if PY_MAJOR_VERSION >= 3
551  #define PyBoolObject PyLongObject
552 #endif
553 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
554  #ifndef PyUnicode_InternFromString
555  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
556  #endif
557 #endif
558 #if PY_VERSION_HEX < 0x030200A4
559  typedef long Py_hash_t;
560  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
561  #define __Pyx_PyInt_AsHash_t PyInt_AsLong
562 #else
563  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
564  #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
565 #endif
566 #if PY_MAJOR_VERSION >= 3
567  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
568 #else
569  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
570 #endif
571 #if CYTHON_USE_ASYNC_SLOTS
572  #if PY_VERSION_HEX >= 0x030500B1
573  #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
574  #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
575  #else
576  #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
577  #endif
578 #else
579  #define __Pyx_PyType_AsAsync(obj) NULL
580 #endif
581 #ifndef __Pyx_PyAsyncMethodsStruct
582  typedef struct {
583  unaryfunc am_await;
584  unaryfunc am_aiter;
585  unaryfunc am_anext;
586  } __Pyx_PyAsyncMethodsStruct;
587 #endif
588 
589 #if defined(WIN32) || defined(MS_WINDOWS)
590  #define _USE_MATH_DEFINES
591 #endif
592 #include <math.h>
593 #ifdef NAN
594 #define __PYX_NAN() ((float) NAN)
595 #else
596 static CYTHON_INLINE float __PYX_NAN() {
597  float value;
598  memset(&value, 0xFF, sizeof(value));
599  return value;
600 }
601 #endif
602 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
603 #define __Pyx_truncl trunc
604 #else
605 #define __Pyx_truncl truncl
606 #endif
607 
608 
609 #define __PYX_ERR(f_index, lineno, Ln_error) \
610 { \
611  __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
612 }
613 
614 #ifndef __PYX_EXTERN_C
615  #ifdef __cplusplus
616  #define __PYX_EXTERN_C extern "C"
617  #else
618  #define __PYX_EXTERN_C extern
619  #endif
620 #endif
621 
622 #define __PYX_HAVE__BoundaryConditions
623 #define __PYX_HAVE_API__BoundaryConditions
624 /* Early includes */
625 #include <string.h>
626 #include <stdio.h>
627 #include "numpy/arrayobject.h"
628 #include "numpy/ufuncobject.h"
629 #include "pythread.h"
630 #include <stdlib.h>
631 #include "pystate.h"
632 #ifdef _OPENMP
633 #include <omp.h>
634 #endif /* _OPENMP */
635 
636 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
637 #define CYTHON_WITHOUT_ASSERTIONS
638 #endif
639 
640 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
641  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
642 
643 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
644 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
645 #define __PYX_DEFAULT_STRING_ENCODING ""
646 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
647 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
648 #define __Pyx_uchar_cast(c) ((unsigned char)c)
649 #define __Pyx_long_cast(x) ((long)x)
650 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
651  (sizeof(type) < sizeof(Py_ssize_t)) ||\
652  (sizeof(type) > sizeof(Py_ssize_t) &&\
653  likely(v < (type)PY_SSIZE_T_MAX ||\
654  v == (type)PY_SSIZE_T_MAX) &&\
655  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
656  v == (type)PY_SSIZE_T_MIN))) ||\
657  (sizeof(type) == sizeof(Py_ssize_t) &&\
658  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
659  v == (type)PY_SSIZE_T_MAX))) )
660 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
661  return (size_t) i < (size_t) limit;
662 }
663 #if defined (__cplusplus) && __cplusplus >= 201103L
664  #include <cstdlib>
665  #define __Pyx_sst_abs(value) std::abs(value)
666 #elif SIZEOF_INT >= SIZEOF_SIZE_T
667  #define __Pyx_sst_abs(value) abs(value)
668 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
669  #define __Pyx_sst_abs(value) labs(value)
670 #elif defined (_MSC_VER)
671  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
672 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
673  #define __Pyx_sst_abs(value) llabs(value)
674 #elif defined (__GNUC__)
675  #define __Pyx_sst_abs(value) __builtin_llabs(value)
676 #else
677  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
678 #endif
679 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
680 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
681 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
682 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
683 #define __Pyx_PyBytes_FromString PyBytes_FromString
684 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
685 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
686 #if PY_MAJOR_VERSION < 3
687  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
688  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
689 #else
690  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
691  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
692 #endif
693 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
694 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
695 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
696 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
697 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
698 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
699 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
700 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
701 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
702 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
703 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
704 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
705 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
706 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
707 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
708 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
709 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
710  const Py_UNICODE *u_end = u;
711  while (*u_end++) ;
712  return (size_t)(u_end - u - 1);
713 }
714 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
715 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
716 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
717 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
718 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
719 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
720 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
721 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
722 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
723 #define __Pyx_PySequence_Tuple(obj)\
724  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
725 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
726 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
727 #if CYTHON_ASSUME_SAFE_MACROS
728 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
729 #else
730 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
731 #endif
732 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
733 #if PY_MAJOR_VERSION >= 3
734 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
735 #else
736 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
737 #endif
738 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
739 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
740 static int __Pyx_sys_getdefaultencoding_not_ascii;
741 static int __Pyx_init_sys_getdefaultencoding_params(void) {
742  PyObject* sys;
743  PyObject* default_encoding = NULL;
744  PyObject* ascii_chars_u = NULL;
745  PyObject* ascii_chars_b = NULL;
746  const char* default_encoding_c;
747  sys = PyImport_ImportModule("sys");
748  if (!sys) goto bad;
749  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
750  Py_DECREF(sys);
751  if (!default_encoding) goto bad;
752  default_encoding_c = PyBytes_AsString(default_encoding);
753  if (!default_encoding_c) goto bad;
754  if (strcmp(default_encoding_c, "ascii") == 0) {
755  __Pyx_sys_getdefaultencoding_not_ascii = 0;
756  } else {
757  char ascii_chars[128];
758  int c;
759  for (c = 0; c < 128; c++) {
760  ascii_chars[c] = c;
761  }
762  __Pyx_sys_getdefaultencoding_not_ascii = 1;
763  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
764  if (!ascii_chars_u) goto bad;
765  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
766  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
767  PyErr_Format(
768  PyExc_ValueError,
769  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
770  default_encoding_c);
771  goto bad;
772  }
773  Py_DECREF(ascii_chars_u);
774  Py_DECREF(ascii_chars_b);
775  }
776  Py_DECREF(default_encoding);
777  return 0;
778 bad:
779  Py_XDECREF(default_encoding);
780  Py_XDECREF(ascii_chars_u);
781  Py_XDECREF(ascii_chars_b);
782  return -1;
783 }
784 #endif
785 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
786 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
787 #else
788 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
789 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
790 static char* __PYX_DEFAULT_STRING_ENCODING;
791 static int __Pyx_init_sys_getdefaultencoding_params(void) {
792  PyObject* sys;
793  PyObject* default_encoding = NULL;
794  char* default_encoding_c;
795  sys = PyImport_ImportModule("sys");
796  if (!sys) goto bad;
797  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
798  Py_DECREF(sys);
799  if (!default_encoding) goto bad;
800  default_encoding_c = PyBytes_AsString(default_encoding);
801  if (!default_encoding_c) goto bad;
802  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
803  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
804  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
805  Py_DECREF(default_encoding);
806  return 0;
807 bad:
808  Py_XDECREF(default_encoding);
809  return -1;
810 }
811 #endif
812 #endif
813 
814 
815 /* Test for GCC > 2.95 */
816 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
817  #define likely(x) __builtin_expect(!!(x), 1)
818  #define unlikely(x) __builtin_expect(!!(x), 0)
819 #else /* !__GNUC__ or GCC < 2.95 */
820  #define likely(x) (x)
821  #define unlikely(x) (x)
822 #endif /* __GNUC__ */
823 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
824 
825 static PyObject *__pyx_m = NULL;
826 static PyObject *__pyx_d;
827 static PyObject *__pyx_b;
828 static PyObject *__pyx_cython_runtime = NULL;
829 static PyObject *__pyx_empty_tuple;
830 static PyObject *__pyx_empty_bytes;
831 static PyObject *__pyx_empty_unicode;
832 static int __pyx_lineno;
833 static int __pyx_clineno = 0;
834 static const char * __pyx_cfilenm= __FILE__;
835 static const char *__pyx_filename;
836 
837 /* Header.proto */
838 #if !defined(CYTHON_CCOMPLEX)
839  #if defined(__cplusplus)
840  #define CYTHON_CCOMPLEX 1
841  #elif defined(_Complex_I)
842  #define CYTHON_CCOMPLEX 1
843  #else
844  #define CYTHON_CCOMPLEX 0
845  #endif
846 #endif
847 #if CYTHON_CCOMPLEX
848  #ifdef __cplusplus
849  #include <complex>
850  #else
851  #include <complex.h>
852  #endif
853 #endif
854 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
855  #undef _Complex_I
856  #define _Complex_I 1.0fj
857 #endif
858 
859 
860 static const char *__pyx_f[] = {
861  "proteus/BoundaryConditions.py",
862  "stringsource",
863  "proteus/BoundaryConditions.pxd",
864  "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd",
865  "linux/lib/python3.7/site-packages/Cython/Includes/cpython/type.pxd",
866 };
867 /* MemviewSliceStruct.proto */
868 struct __pyx_memoryview_obj;
869 typedef struct {
870  struct __pyx_memoryview_obj *memview;
871  char *data;
872  Py_ssize_t shape[8];
873  Py_ssize_t strides[8];
874  Py_ssize_t suboffsets[8];
875 } __Pyx_memviewslice;
876 #define __Pyx_MemoryView_Len(m) (m.shape[0])
877 
878 /* Atomics.proto */
879 #include <pythread.h>
880 #ifndef CYTHON_ATOMICS
881  #define CYTHON_ATOMICS 1
882 #endif
883 #define __pyx_atomic_int_type int
884 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
885  (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
886  !defined(__i386__)
887  #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
888  #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
889  #ifdef __PYX_DEBUG_ATOMICS
890  #warning "Using GNU atomics"
891  #endif
892 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
893  #include <Windows.h>
894  #undef __pyx_atomic_int_type
895  #define __pyx_atomic_int_type LONG
896  #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
897  #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
898  #ifdef __PYX_DEBUG_ATOMICS
899  #pragma message ("Using MSVC atomics")
900  #endif
901 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
902  #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
903  #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
904  #ifdef __PYX_DEBUG_ATOMICS
905  #warning "Using Intel atomics"
906  #endif
907 #else
908  #undef CYTHON_ATOMICS
909  #define CYTHON_ATOMICS 0
910  #ifdef __PYX_DEBUG_ATOMICS
911  #warning "Not using atomics"
912  #endif
913 #endif
914 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
915 #if CYTHON_ATOMICS
916  #define __pyx_add_acquisition_count(memview)\
917  __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
918  #define __pyx_sub_acquisition_count(memview)\
919  __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
920 #else
921  #define __pyx_add_acquisition_count(memview)\
922  __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
923  #define __pyx_sub_acquisition_count(memview)\
924  __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
925 #endif
926 
927 /* ForceInitThreads.proto */
928 #ifndef __PYX_FORCE_INIT_THREADS
929  #define __PYX_FORCE_INIT_THREADS 0
930 #endif
931 
932 /* NoFastGil.proto */
933 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
934 #define __Pyx_PyGILState_Release PyGILState_Release
935 #define __Pyx_FastGIL_Remember()
936 #define __Pyx_FastGIL_Forget()
937 #define __Pyx_FastGilFuncInit()
938 
939 /* BufferFormatStructs.proto */
940 #define IS_UNSIGNED(type) (((type) -1) > 0)
941 struct __Pyx_StructField_;
942 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
943 typedef struct {
944  const char* name;
945  struct __Pyx_StructField_* fields;
946  size_t size;
947  size_t arraysize[8];
948  int ndim;
949  char typegroup;
950  char is_unsigned;
951  int flags;
952 } __Pyx_TypeInfo;
953 typedef struct __Pyx_StructField_ {
954  __Pyx_TypeInfo* type;
955  const char* name;
956  size_t offset;
957 } __Pyx_StructField;
958 typedef struct {
959  __Pyx_StructField* field;
960  size_t parent_offset;
961 } __Pyx_BufFmt_StackElem;
962 typedef struct {
963  __Pyx_StructField root;
964  __Pyx_BufFmt_StackElem* head;
965  size_t fmt_offset;
966  size_t new_count, enc_count;
967  size_t struct_alignment;
968  int is_complex;
969  char enc_type;
970  char new_packmode;
971  char enc_packmode;
972  char is_valid_array;
973 } __Pyx_BufFmt_Context;
974 
975 
976 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":776
977  * # in Cython to enable them only on the right systems.
978  *
979  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
980  * ctypedef npy_int16 int16_t
981  * ctypedef npy_int32 int32_t
982  */
983 typedef npy_int8 __pyx_t_5numpy_int8_t;
984 
985 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":777
986  *
987  * ctypedef npy_int8 int8_t
988  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
989  * ctypedef npy_int32 int32_t
990  * ctypedef npy_int64 int64_t
991  */
992 typedef npy_int16 __pyx_t_5numpy_int16_t;
993 
994 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":778
995  * ctypedef npy_int8 int8_t
996  * ctypedef npy_int16 int16_t
997  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
998  * ctypedef npy_int64 int64_t
999  * #ctypedef npy_int96 int96_t
1000  */
1001 typedef npy_int32 __pyx_t_5numpy_int32_t;
1002 
1003 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":779
1004  * ctypedef npy_int16 int16_t
1005  * ctypedef npy_int32 int32_t
1006  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1007  * #ctypedef npy_int96 int96_t
1008  * #ctypedef npy_int128 int128_t
1009  */
1010 typedef npy_int64 __pyx_t_5numpy_int64_t;
1011 
1012 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":783
1013  * #ctypedef npy_int128 int128_t
1014  *
1015  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1016  * ctypedef npy_uint16 uint16_t
1017  * ctypedef npy_uint32 uint32_t
1018  */
1019 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1020 
1021 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":784
1022  *
1023  * ctypedef npy_uint8 uint8_t
1024  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1025  * ctypedef npy_uint32 uint32_t
1026  * ctypedef npy_uint64 uint64_t
1027  */
1028 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1029 
1030 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":785
1031  * ctypedef npy_uint8 uint8_t
1032  * ctypedef npy_uint16 uint16_t
1033  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1034  * ctypedef npy_uint64 uint64_t
1035  * #ctypedef npy_uint96 uint96_t
1036  */
1037 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1038 
1039 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":786
1040  * ctypedef npy_uint16 uint16_t
1041  * ctypedef npy_uint32 uint32_t
1042  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1043  * #ctypedef npy_uint96 uint96_t
1044  * #ctypedef npy_uint128 uint128_t
1045  */
1046 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1047 
1048 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":790
1049  * #ctypedef npy_uint128 uint128_t
1050  *
1051  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1052  * ctypedef npy_float64 float64_t
1053  * #ctypedef npy_float80 float80_t
1054  */
1055 typedef npy_float32 __pyx_t_5numpy_float32_t;
1056 
1057 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":791
1058  *
1059  * ctypedef npy_float32 float32_t
1060  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1061  * #ctypedef npy_float80 float80_t
1062  * #ctypedef npy_float128 float128_t
1063  */
1064 typedef npy_float64 __pyx_t_5numpy_float64_t;
1065 
1066 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":800
1067  * # The int types are mapped a bit surprising --
1068  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1069  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
1070  * ctypedef npy_longlong long_t
1071  * ctypedef npy_longlong longlong_t
1072  */
1073 typedef npy_long __pyx_t_5numpy_int_t;
1074 
1075 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":801
1076  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1077  * ctypedef npy_long int_t
1078  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
1079  * ctypedef npy_longlong longlong_t
1080  *
1081  */
1082 typedef npy_longlong __pyx_t_5numpy_long_t;
1083 
1084 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":802
1085  * ctypedef npy_long int_t
1086  * ctypedef npy_longlong long_t
1087  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1088  *
1089  * ctypedef npy_ulong uint_t
1090  */
1091 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1092 
1093 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":804
1094  * ctypedef npy_longlong longlong_t
1095  *
1096  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1097  * ctypedef npy_ulonglong ulong_t
1098  * ctypedef npy_ulonglong ulonglong_t
1099  */
1100 typedef npy_ulong __pyx_t_5numpy_uint_t;
1101 
1102 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":805
1103  *
1104  * ctypedef npy_ulong uint_t
1105  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1106  * ctypedef npy_ulonglong ulonglong_t
1107  *
1108  */
1109 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1110 
1111 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":806
1112  * ctypedef npy_ulong uint_t
1113  * ctypedef npy_ulonglong ulong_t
1114  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1115  *
1116  * ctypedef npy_intp intp_t
1117  */
1118 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1119 
1120 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":808
1121  * ctypedef npy_ulonglong ulonglong_t
1122  *
1123  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1124  * ctypedef npy_uintp uintp_t
1125  *
1126  */
1127 typedef npy_intp __pyx_t_5numpy_intp_t;
1128 
1129 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":809
1130  *
1131  * ctypedef npy_intp intp_t
1132  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1133  *
1134  * ctypedef npy_double float_t
1135  */
1136 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1137 
1138 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":811
1139  * ctypedef npy_uintp uintp_t
1140  *
1141  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1142  * ctypedef npy_double double_t
1143  * ctypedef npy_longdouble longdouble_t
1144  */
1145 typedef npy_double __pyx_t_5numpy_float_t;
1146 
1147 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":812
1148  *
1149  * ctypedef npy_double float_t
1150  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1151  * ctypedef npy_longdouble longdouble_t
1152  *
1153  */
1154 typedef npy_double __pyx_t_5numpy_double_t;
1155 
1156 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":813
1157  * ctypedef npy_double float_t
1158  * ctypedef npy_double double_t
1159  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1160  *
1161  * ctypedef npy_cfloat cfloat_t
1162  */
1163 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1164 /* Declarations.proto */
1165 #if CYTHON_CCOMPLEX
1166  #ifdef __cplusplus
1167  typedef ::std::complex< float > __pyx_t_float_complex;
1168  #else
1169  typedef float _Complex __pyx_t_float_complex;
1170  #endif
1171 #else
1172  typedef struct { float real, imag; } __pyx_t_float_complex;
1173 #endif
1174 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1175 
1176 /* Declarations.proto */
1177 #if CYTHON_CCOMPLEX
1178  #ifdef __cplusplus
1179  typedef ::std::complex< double > __pyx_t_double_complex;
1180  #else
1181  typedef double _Complex __pyx_t_double_complex;
1182  #endif
1183 #else
1184  typedef struct { double real, imag; } __pyx_t_double_complex;
1185 #endif
1186 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1187 
1188 
1189 /*--- Type declarations ---*/
1190 struct __pyx_obj_18BoundaryConditions_BC_Base;
1191 struct __pyx_obj_18BoundaryConditions_BoundaryCondition;
1192 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC;
1193 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC;
1194 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp;
1195 struct __pyx_array_obj;
1196 struct __pyx_MemviewEnum_obj;
1197 struct __pyx_memoryview_obj;
1198 struct __pyx_memoryviewslice_obj;
1199 
1200 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":815
1201  * ctypedef npy_longdouble longdouble_t
1202  *
1203  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1204  * ctypedef npy_cdouble cdouble_t
1205  * ctypedef npy_clongdouble clongdouble_t
1206  */
1207 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1208 
1209 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":816
1210  *
1211  * ctypedef npy_cfloat cfloat_t
1212  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1213  * ctypedef npy_clongdouble clongdouble_t
1214  *
1215  */
1216 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1217 
1218 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":817
1219  * ctypedef npy_cfloat cfloat_t
1220  * ctypedef npy_cdouble cdouble_t
1221  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1222  *
1223  * ctypedef npy_cdouble complex_t
1224  */
1225 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1226 
1227 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":819
1228  * ctypedef npy_clongdouble clongdouble_t
1229  *
1230  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1231  *
1232  * cdef inline object PyArray_MultiIterNew1(a):
1233  */
1234 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1235 struct __pyx_defaults;
1236 typedef struct __pyx_defaults __pyx_defaults;
1237 struct __pyx_defaults1;
1238 typedef struct __pyx_defaults1 __pyx_defaults1;
1239 struct __pyx_defaults2;
1240 typedef struct __pyx_defaults2 __pyx_defaults2;
1241 
1242 /* "BoundaryConditions.pxd":16
1243  * # cpdef void getContext(BC_Base cls, object context=*)
1244  *
1245  * ctypedef double (*cpp_uOfXT) (BoundaryCondition, double[:], double) # <<<<<<<<<<<<<<
1246  * cdef class BoundaryCondition:
1247  * cdef cpp_uOfXT uuOfXT
1248  */
1249 typedef double (*__pyx_t_18BoundaryConditions_cpp_uOfXT)(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *, __Pyx_memviewslice, double);
1250 struct __pyx_defaults {
1251  PyObject *__pyx_arg_n;
1252 };
1253 struct __pyx_defaults1 {
1254  PyObject *__pyx_arg_n;
1255 };
1256 struct __pyx_defaults2 {
1257  PyObject *__pyx_arg_n;
1258 };
1259 
1260 /* "BoundaryConditions.pxd":5
1261  * import cython
1262  *
1263  * cdef class BC_Base: # <<<<<<<<<<<<<<
1264  * cdef double[:] _b_or
1265  * cdef public:
1266  */
1267 struct __pyx_obj_18BoundaryConditions_BC_Base {
1268  PyObject_HEAD
1269  __Pyx_memviewslice _b_or;
1270  int nd;
1271  PyObject *Shape;
1272  PyObject *name;
1273  PyObject *BC_type;
1274  PyObject *ct;
1275 };
1276 
1277 
1278 /* "BoundaryConditions.pxd":17
1279  *
1280  * ctypedef double (*cpp_uOfXT) (BoundaryCondition, double[:], double)
1281  * cdef class BoundaryCondition: # <<<<<<<<<<<<<<
1282  * cdef cpp_uOfXT uuOfXT
1283  * cdef public:
1284  */
1285 struct __pyx_obj_18BoundaryConditions_BoundaryCondition {
1286  PyObject_HEAD
1287  struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition *__pyx_vtab;
1288  __pyx_t_18BoundaryConditions_cpp_uOfXT uuOfXT;
1289  PyObject *uOfXT;
1290 };
1291 
1292 
1293 /* "BoundaryConditions.py":87
1294  * self.uOfXT = None
1295  *
1296  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
1297  * """
1298  * function returning constant BC
1299  */
1300 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC {
1301  PyObject_HEAD
1302  PyObject *__pyx_v_value;
1303 };
1304 
1305 
1306 /* "BoundaryConditions.py":100
1307  *
1308  *
1309  * def setLinearBC(self, a0, a): # <<<<<<<<<<<<<<
1310  * """
1311  * function returning value=a0+ax*x+ay*y+az*z
1312  */
1313 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC {
1314  PyObject_HEAD
1315  PyObject *__pyx_v_a;
1316  PyObject *__pyx_v_a0;
1317 };
1318 
1319 
1320 /* "BoundaryConditions.py":115
1321  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:])
1322  *
1323  * def setLinearRamp(self,t1,value): # <<<<<<<<<<<<<<
1324  * """
1325  * function setting a linear ramp from t=0 to t=t1
1326  */
1327 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp {
1328  PyObject_HEAD
1329  PyObject *__pyx_v_t1;
1330  PyObject *__pyx_v_value;
1331 };
1332 
1333 
1334 /* "View.MemoryView":105
1335  *
1336  * @cname("__pyx_array")
1337  * cdef class array: # <<<<<<<<<<<<<<
1338  *
1339  * cdef:
1340  */
1341 struct __pyx_array_obj {
1342  PyObject_HEAD
1343  struct __pyx_vtabstruct_array *__pyx_vtab;
1344  char *data;
1345  Py_ssize_t len;
1346  char *format;
1347  int ndim;
1348  Py_ssize_t *_shape;
1349  Py_ssize_t *_strides;
1350  Py_ssize_t itemsize;
1351  PyObject *mode;
1352  PyObject *_format;
1353  void (*callback_free_data)(void *);
1354  int free_data;
1355  int dtype_is_object;
1356 };
1357 
1358 
1359 /* "View.MemoryView":279
1360  *
1361  * @cname('__pyx_MemviewEnum')
1362  * cdef class Enum(object): # <<<<<<<<<<<<<<
1363  * cdef object name
1364  * def __init__(self, name):
1365  */
1366 struct __pyx_MemviewEnum_obj {
1367  PyObject_HEAD
1368  PyObject *name;
1369 };
1370 
1371 
1372 /* "View.MemoryView":330
1373  *
1374  * @cname('__pyx_memoryview')
1375  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1376  *
1377  * cdef object obj
1378  */
1379 struct __pyx_memoryview_obj {
1380  PyObject_HEAD
1381  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1382  PyObject *obj;
1383  PyObject *_size;
1384  PyObject *_array_interface;
1385  PyThread_type_lock lock;
1386  __pyx_atomic_int acquisition_count[2];
1387  __pyx_atomic_int *acquisition_count_aligned_p;
1388  Py_buffer view;
1389  int flags;
1390  int dtype_is_object;
1391  __Pyx_TypeInfo *typeinfo;
1392 };
1393 
1394 
1395 /* "View.MemoryView":961
1396  *
1397  * @cname('__pyx_memoryviewslice')
1398  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1399  * "Internal class for passing memoryview slices to Python"
1400  *
1401  */
1402 struct __pyx_memoryviewslice_obj {
1403  struct __pyx_memoryview_obj __pyx_base;
1404  __Pyx_memviewslice from_slice;
1405  PyObject *from_object;
1406  PyObject *(*to_object_func)(char *);
1407  int (*to_dtype_func)(char *, PyObject *);
1408 };
1409 
1410 
1411 
1412 /* "BoundaryConditions.py":68
1413  *
1414  *
1415  * class BoundaryCondition: # <<<<<<<<<<<<<<
1416  * """
1417  * Boundary condition class
1418  */
1419 
1420 struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition {
1421  void (*resetBC)(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *, int __pyx_skip_dispatch);
1422 };
1423 static struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition *__pyx_vtabptr_18BoundaryConditions_BoundaryCondition;
1424 
1425 
1426 /* "View.MemoryView":105
1427  *
1428  * @cname("__pyx_array")
1429  * cdef class array: # <<<<<<<<<<<<<<
1430  *
1431  * cdef:
1432  */
1433 
1434 struct __pyx_vtabstruct_array {
1435  PyObject *(*get_memview)(struct __pyx_array_obj *);
1436 };
1437 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1438 
1439 
1440 /* "View.MemoryView":330
1441  *
1442  * @cname('__pyx_memoryview')
1443  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1444  *
1445  * cdef object obj
1446  */
1447 
1448 struct __pyx_vtabstruct_memoryview {
1449  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1450  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1451  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1452  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1453  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1454  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1455  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1456 };
1457 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1458 
1459 
1460 /* "View.MemoryView":961
1461  *
1462  * @cname('__pyx_memoryviewslice')
1463  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1464  * "Internal class for passing memoryview slices to Python"
1465  *
1466  */
1467 
1468 struct __pyx_vtabstruct__memoryviewslice {
1469  struct __pyx_vtabstruct_memoryview __pyx_base;
1470 };
1471 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1472 
1473 /* --- Runtime support code (head) --- */
1474 /* Refnanny.proto */
1475 #ifndef CYTHON_REFNANNY
1476  #define CYTHON_REFNANNY 0
1477 #endif
1478 #if CYTHON_REFNANNY
1479  typedef struct {
1480  void (*INCREF)(void*, PyObject*, int);
1481  void (*DECREF)(void*, PyObject*, int);
1482  void (*GOTREF)(void*, PyObject*, int);
1483  void (*GIVEREF)(void*, PyObject*, int);
1484  void* (*SetupContext)(const char*, int, const char*);
1485  void (*FinishContext)(void**);
1486  } __Pyx_RefNannyAPIStruct;
1487  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1488  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1489  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1490 #ifdef WITH_THREAD
1491  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1492  if (acquire_gil) {\
1493  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1494  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1495  PyGILState_Release(__pyx_gilstate_save);\
1496  } else {\
1497  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1498  }
1499 #else
1500  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1501  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1502 #endif
1503  #define __Pyx_RefNannyFinishContext()\
1504  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1505  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1506  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1507  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1508  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1509  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1510  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1511  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1512  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1513 #else
1514  #define __Pyx_RefNannyDeclarations
1515  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1516  #define __Pyx_RefNannyFinishContext()
1517  #define __Pyx_INCREF(r) Py_INCREF(r)
1518  #define __Pyx_DECREF(r) Py_DECREF(r)
1519  #define __Pyx_GOTREF(r)
1520  #define __Pyx_GIVEREF(r)
1521  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1522  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1523  #define __Pyx_XGOTREF(r)
1524  #define __Pyx_XGIVEREF(r)
1525 #endif
1526 #define __Pyx_XDECREF_SET(r, v) do {\
1527  PyObject *tmp = (PyObject *) r;\
1528  r = v; __Pyx_XDECREF(tmp);\
1529  } while (0)
1530 #define __Pyx_DECREF_SET(r, v) do {\
1531  PyObject *tmp = (PyObject *) r;\
1532  r = v; __Pyx_DECREF(tmp);\
1533  } while (0)
1534 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1535 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1536 
1537 /* PyObjectGetAttrStr.proto */
1538 #if CYTHON_USE_TYPE_SLOTS
1539 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1540 #else
1541 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1542 #endif
1543 
1544 /* GetBuiltinName.proto */
1545 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1546 
1547 /* RaiseDoubleKeywords.proto */
1548 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1549 
1550 /* ParseKeywords.proto */
1551 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1552  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1553  const char* function_name);
1554 
1555 /* RaiseArgTupleInvalid.proto */
1556 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1557  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1558 
1559 /* PyThreadStateGet.proto */
1560 #if CYTHON_FAST_THREAD_STATE
1561 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1562 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1563 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1564 #else
1565 #define __Pyx_PyThreadState_declare
1566 #define __Pyx_PyThreadState_assign
1567 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1568 #endif
1569 
1570 /* PyErrFetchRestore.proto */
1571 #if CYTHON_FAST_THREAD_STATE
1572 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1573 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1574 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1575 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1576 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1577 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1578 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1579 #if CYTHON_COMPILING_IN_CPYTHON
1580 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1581 #else
1582 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1583 #endif
1584 #else
1585 #define __Pyx_PyErr_Clear() PyErr_Clear()
1586 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1587 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1588 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1589 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1590 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1591 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1592 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1593 #endif
1594 
1595 /* Profile.proto */
1596 #ifndef CYTHON_PROFILE
1597 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
1598  #define CYTHON_PROFILE 0
1599 #else
1600  #define CYTHON_PROFILE 1
1601 #endif
1602 #endif
1603 #ifndef CYTHON_TRACE_NOGIL
1604  #define CYTHON_TRACE_NOGIL 0
1605 #else
1606  #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE)
1607  #define CYTHON_TRACE 1
1608  #endif
1609 #endif
1610 #ifndef CYTHON_TRACE
1611  #define CYTHON_TRACE 0
1612 #endif
1613 #if CYTHON_TRACE
1614  #undef CYTHON_PROFILE_REUSE_FRAME
1615 #endif
1616 #ifndef CYTHON_PROFILE_REUSE_FRAME
1617  #define CYTHON_PROFILE_REUSE_FRAME 0
1618 #endif
1619 #if CYTHON_PROFILE || CYTHON_TRACE
1620  #include "compile.h"
1621  #include "frameobject.h"
1622  #include "traceback.h"
1623  #if CYTHON_PROFILE_REUSE_FRAME
1624  #define CYTHON_FRAME_MODIFIER static
1625  #define CYTHON_FRAME_DEL(frame)
1626  #else
1627  #define CYTHON_FRAME_MODIFIER
1628  #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
1629  #endif
1630  #define __Pyx_TraceDeclarations\
1631  static PyCodeObject *__pyx_frame_code = NULL;\
1632  CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
1633  int __Pyx_use_tracing = 0;
1634  #define __Pyx_TraceFrameInit(codeobj)\
1635  if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj;
1636  #ifdef WITH_THREAD
1637  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1638  if (nogil) {\
1639  if (CYTHON_TRACE_NOGIL) {\
1640  PyThreadState *tstate;\
1641  PyGILState_STATE state = PyGILState_Ensure();\
1642  tstate = __Pyx_PyThreadState_Current;\
1643  if (unlikely(tstate->use_tracing) && !tstate->tracing &&\
1644  (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc))) {\
1645  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1646  }\
1647  PyGILState_Release(state);\
1648  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1649  }\
1650  } else {\
1651  PyThreadState* tstate = PyThreadState_GET();\
1652  if (unlikely(tstate->use_tracing) && !tstate->tracing &&\
1653  (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc))) {\
1654  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1655  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1656  }\
1657  }
1658  #else
1659  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1660  { PyThreadState* tstate = PyThreadState_GET();\
1661  if (unlikely(tstate->use_tracing) && !tstate->tracing &&\
1662  (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc))) {\
1663  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1664  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1665  }\
1666  }
1667  #endif
1668  #define __Pyx_TraceException()\
1669  if (likely(!__Pyx_use_tracing)); else {\
1670  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1671  if (tstate->use_tracing &&\
1672  (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc))) {\
1673  tstate->tracing++;\
1674  tstate->use_tracing = 0;\
1675  PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\
1676  if (exc_info) {\
1677  if (CYTHON_TRACE && tstate->c_tracefunc)\
1678  tstate->c_tracefunc(\
1679  tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1680  tstate->c_profilefunc(\
1681  tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1682  Py_DECREF(exc_info);\
1683  }\
1684  tstate->use_tracing = 1;\
1685  tstate->tracing--;\
1686  }\
1687  }
1688  static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) {
1689  PyObject *type, *value, *traceback;
1690  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1691  tstate->tracing++;
1692  tstate->use_tracing = 0;
1693  if (CYTHON_TRACE && tstate->c_tracefunc)
1694  tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result);
1695  if (tstate->c_profilefunc)
1696  tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result);
1697  CYTHON_FRAME_DEL(frame);
1698  tstate->use_tracing = 1;
1699  tstate->tracing--;
1700  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1701  }
1702  #ifdef WITH_THREAD
1703  #define __Pyx_TraceReturn(result, nogil)\
1704  if (likely(!__Pyx_use_tracing)); else {\
1705  if (nogil) {\
1706  if (CYTHON_TRACE_NOGIL) {\
1707  PyThreadState *tstate;\
1708  PyGILState_STATE state = PyGILState_Ensure();\
1709  tstate = __Pyx_PyThreadState_Current;\
1710  if (tstate->use_tracing) {\
1711  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1712  }\
1713  PyGILState_Release(state);\
1714  }\
1715  } else {\
1716  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1717  if (tstate->use_tracing) {\
1718  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1719  }\
1720  }\
1721  }
1722  #else
1723  #define __Pyx_TraceReturn(result, nogil)\
1724  if (likely(!__Pyx_use_tracing)); else {\
1725  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1726  if (tstate->use_tracing) {\
1727  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1728  }\
1729  }
1730  #endif
1731  static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno);
1732  static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno);
1733 #else
1734  #define __Pyx_TraceDeclarations
1735  #define __Pyx_TraceFrameInit(codeobj)
1736  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error;
1737  #define __Pyx_TraceException()
1738  #define __Pyx_TraceReturn(result, nogil)
1739 #endif
1740 #if CYTHON_TRACE
1741  static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) {
1742  int ret;
1743  PyObject *type, *value, *traceback;
1744  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1745  __Pyx_PyFrame_SetLineNumber(frame, lineno);
1746  tstate->tracing++;
1747  tstate->use_tracing = 0;
1748  ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL);
1749  tstate->use_tracing = 1;
1750  tstate->tracing--;
1751  if (likely(!ret)) {
1752  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1753  } else {
1754  Py_XDECREF(type);
1755  Py_XDECREF(value);
1756  Py_XDECREF(traceback);
1757  }
1758  return ret;
1759  }
1760  #ifdef WITH_THREAD
1761  #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1762  if (likely(!__Pyx_use_tracing)); else {\
1763  if (nogil) {\
1764  if (CYTHON_TRACE_NOGIL) {\
1765  int ret = 0;\
1766  PyThreadState *tstate;\
1767  PyGILState_STATE state = PyGILState_Ensure();\
1768  tstate = __Pyx_PyThreadState_Current;\
1769  if (unlikely(tstate->use_tracing && tstate->c_tracefunc && __pyx_frame->f_trace)) {\
1770  ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1771  }\
1772  PyGILState_Release(state);\
1773  if (unlikely(ret)) goto_error;\
1774  }\
1775  } else {\
1776  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1777  if (unlikely(tstate->use_tracing && tstate->c_tracefunc && __pyx_frame->f_trace)) {\
1778  int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1779  if (unlikely(ret)) goto_error;\
1780  }\
1781  }\
1782  }
1783  #else
1784  #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1785  if (likely(!__Pyx_use_tracing)); else {\
1786  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1787  if (unlikely(tstate->use_tracing && tstate->c_tracefunc && __pyx_frame->f_trace)) {\
1788  int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1789  if (unlikely(ret)) goto_error;\
1790  }\
1791  }
1792  #endif
1793 #else
1794  #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error;
1795 #endif
1796 
1797 /* GetItemInt.proto */
1798 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1799  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1800  __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1801  (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1802  __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1803 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1804  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1805  __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1806  (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1807 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1808  int wraparound, int boundscheck);
1809 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1810  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1811  __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1812  (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1813 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1814  int wraparound, int boundscheck);
1815 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1816 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1817  int is_list, int wraparound, int boundscheck);
1818 
1819 /* ObjectGetItem.proto */
1820 #if CYTHON_USE_TYPE_SLOTS
1821 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1822 #else
1823 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1824 #endif
1825 
1826 /* MemviewSliceInit.proto */
1827 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1828 #define __Pyx_MEMVIEW_DIRECT 1
1829 #define __Pyx_MEMVIEW_PTR 2
1830 #define __Pyx_MEMVIEW_FULL 4
1831 #define __Pyx_MEMVIEW_CONTIG 8
1832 #define __Pyx_MEMVIEW_STRIDED 16
1833 #define __Pyx_MEMVIEW_FOLLOW 32
1834 #define __Pyx_IS_C_CONTIG 1
1835 #define __Pyx_IS_F_CONTIG 2
1836 static int __Pyx_init_memviewslice(
1837  struct __pyx_memoryview_obj *memview,
1838  int ndim,
1839  __Pyx_memviewslice *memviewslice,
1840  int memview_is_new_reference);
1841 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
1842  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1843 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
1844  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1845 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1846 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1847 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1848 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1849 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
1850 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
1851 
1852 /* Import.proto */
1853 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1854 
1855 /* ImportFrom.proto */
1856 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1857 
1858 /* PyFunctionFastCall.proto */
1859 #if CYTHON_FAST_PYCALL
1860 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1861  __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1862 #if 1 || PY_VERSION_HEX < 0x030600B1
1863 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
1864 #else
1865 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1866 #endif
1867 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1868  (sizeof(char [1 - 2*!(cond)]) - 1)
1869 #ifndef Py_MEMBER_SIZE
1870 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1871 #endif
1872  static size_t __pyx_pyframe_localsplus_offset = 0;
1873  #include "frameobject.h"
1874  #define __Pxy_PyFrame_Initialize_Offsets()\
1875  ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1876  (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1877  #define __Pyx_PyFrame_GetLocalsplus(frame)\
1878  (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1879 #endif
1880 
1881 /* PyObjectCall.proto */
1882 #if CYTHON_COMPILING_IN_CPYTHON
1883 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1884 #else
1885 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1886 #endif
1887 
1888 /* PyObjectCallMethO.proto */
1889 #if CYTHON_COMPILING_IN_CPYTHON
1890 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1891 #endif
1892 
1893 /* PyObjectCallNoArg.proto */
1894 #if CYTHON_COMPILING_IN_CPYTHON
1895 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1896 #else
1897 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1898 #endif
1899 
1900 /* PyCFunctionFastCall.proto */
1901 #if CYTHON_FAST_PYCCALL
1902 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1903 #else
1904 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1905 #endif
1906 
1907 /* PyObjectCallOneArg.proto */
1908 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1909 
1910 /* PyErrExceptionMatches.proto */
1911 #if CYTHON_FAST_THREAD_STATE
1912 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1913 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1914 #else
1915 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1916 #endif
1917 
1918 /* GetAttr.proto */
1919 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1920 
1921 /* GetAttr3.proto */
1922 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1923 
1924 /* GetModuleGlobalName.proto */
1925 #if CYTHON_USE_DICT_VERSIONS
1926 #define __Pyx_GetModuleGlobalName(var, name) {\
1927  static PY_UINT64_T __pyx_dict_version = 0;\
1928  static PyObject *__pyx_dict_cached_value = NULL;\
1929  (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1930  (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1931  __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1932 }
1933 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1934  PY_UINT64_T __pyx_dict_version;\
1935  PyObject *__pyx_dict_cached_value;\
1936  (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1937 }
1938 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1939 #else
1940 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1941 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1942 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1943 #endif
1944 
1945 /* KeywordStringCheck.proto */
1946 static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
1947 
1948 /* WriteUnraisableException.proto */
1949 static void __Pyx_WriteUnraisable(const char *name, int clineno,
1950  int lineno, const char *filename,
1951  int full_traceback, int nogil);
1952 
1953 /* None.proto */
1954 static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);
1955 
1956 /* FetchCommonType.proto */
1957 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1958 
1959 /* CythonFunction.proto */
1960 #define __Pyx_CyFunction_USED 1
1961 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
1962 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
1963 #define __Pyx_CYFUNCTION_CCLASS 0x04
1964 #define __Pyx_CyFunction_GetClosure(f)\
1965  (((__pyx_CyFunctionObject *) (f))->func_closure)
1966 #define __Pyx_CyFunction_GetClassObj(f)\
1967  (((__pyx_CyFunctionObject *) (f))->func_classobj)
1968 #define __Pyx_CyFunction_Defaults(type, f)\
1969  ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
1970 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
1971  ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
1972 typedef struct {
1973  PyCFunctionObject func;
1974 #if PY_VERSION_HEX < 0x030500A0
1975  PyObject *func_weakreflist;
1976 #endif
1977  PyObject *func_dict;
1978  PyObject *func_name;
1979  PyObject *func_qualname;
1980  PyObject *func_doc;
1981  PyObject *func_globals;
1982  PyObject *func_code;
1983  PyObject *func_closure;
1984  PyObject *func_classobj;
1985  void *defaults;
1986  int defaults_pyobjects;
1987  int flags;
1988  PyObject *defaults_tuple;
1989  PyObject *defaults_kwdict;
1990  PyObject *(*defaults_getter)(PyObject *);
1991  PyObject *func_annotations;
1992 } __pyx_CyFunctionObject;
1993 static PyTypeObject *__pyx_CyFunctionType = 0;
1994 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
1995 #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\
1996  __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
1997 static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
1998  int flags, PyObject* qualname,
1999  PyObject *self,
2000  PyObject *module, PyObject *globals,
2001  PyObject* code);
2002 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2003  size_t size,
2004  int pyobjects);
2005 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2006  PyObject *tuple);
2007 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2008  PyObject *dict);
2009 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2010  PyObject *dict);
2011 static int __pyx_CyFunction_init(void);
2012 
2013 /* PyObjectCall2Args.proto */
2014 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
2015 
2016 /* SliceObject.proto */
2017 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
2018  PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
2019  PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
2020  int has_cstart, int has_cstop, int wraparound);
2021 
2022 /* RaiseException.proto */
2023 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2024 
2025 /* HasAttr.proto */
2026 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2027 
2028 /* DictGetItem.proto */
2029 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
2030 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
2031 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
2032  (likely(PyDict_CheckExact(obj)) ?\
2033  __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
2034 #else
2035 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
2036 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
2037 #endif
2038 
2039 /* RaiseTooManyValuesToUnpack.proto */
2040 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2041 
2042 /* RaiseNeedMoreValuesToUnpack.proto */
2043 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2044 
2045 /* RaiseNoneIterError.proto */
2046 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
2047 
2048 /* ExtTypeTest.proto */
2049 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2050 
2051 /* GetTopmostException.proto */
2052 #if CYTHON_USE_EXC_INFO_STACK
2053 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2054 #endif
2055 
2056 /* SaveResetException.proto */
2057 #if CYTHON_FAST_THREAD_STATE
2058 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2059 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2060 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2061 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2062 #else
2063 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2064 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2065 #endif
2066 
2067 /* GetException.proto */
2068 #if CYTHON_FAST_THREAD_STATE
2069 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2070 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2071 #else
2072 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2073 #endif
2074 
2075 /* ArgTypeTest.proto */
2076 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
2077  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
2078  __Pyx__ArgTypeTest(obj, type, name, exact))
2079 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
2080 
2081 /* IncludeStringH.proto */
2082 #include <string.h>
2083 
2084 /* BytesEquals.proto */
2085 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
2086 
2087 /* UnicodeEquals.proto */
2088 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
2089 
2090 /* StrEquals.proto */
2091 #if PY_MAJOR_VERSION >= 3
2092 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2093 #else
2094 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2095 #endif
2096 
2097 /* None.proto */
2098 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
2099 
2100 /* UnaryNegOverflows.proto */
2101 #define UNARY_NEG_WOULD_OVERFLOW(x)\
2102  (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2103 
2104 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2105 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
2106 /* decode_c_string_utf16.proto */
2107 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
2108  int byteorder = 0;
2109  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2110 }
2111 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
2112  int byteorder = -1;
2113  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2114 }
2115 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
2116  int byteorder = 1;
2117  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2118 }
2119 
2120 /* decode_c_string.proto */
2121 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
2122  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
2123  const char* encoding, const char* errors,
2124  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
2125 
2126 /* SwapException.proto */
2127 #if CYTHON_FAST_THREAD_STATE
2128 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2129 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2130 #else
2131 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2132 #endif
2133 
2134 /* FastTypeChecks.proto */
2135 #if CYTHON_COMPILING_IN_CPYTHON
2136 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2137 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2138 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2139 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2140 #else
2141 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2142 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2143 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2144 #endif
2145 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2146 
2147 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2148 /* ListCompAppend.proto */
2149 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2150 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2151  PyListObject* L = (PyListObject*) list;
2152  Py_ssize_t len = Py_SIZE(list);
2153  if (likely(L->allocated > len)) {
2154  Py_INCREF(x);
2155  PyList_SET_ITEM(list, len, x);
2156  Py_SIZE(list) = len+1;
2157  return 0;
2158  }
2159  return PyList_Append(list, x);
2160 }
2161 #else
2162 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2163 #endif
2164 
2165 /* PyIntBinop.proto */
2166 #if !CYTHON_COMPILING_IN_PYPY
2167 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
2168 #else
2169 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
2170  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
2171 #endif
2172 
2173 /* ListExtend.proto */
2174 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
2175 #if CYTHON_COMPILING_IN_CPYTHON
2176  PyObject* none = _PyList_Extend((PyListObject*)L, v);
2177  if (unlikely(!none))
2178  return -1;
2179  Py_DECREF(none);
2180  return 0;
2181 #else
2182  return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
2183 #endif
2184 }
2185 
2186 /* ListAppend.proto */
2187 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2188 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2189  PyListObject* L = (PyListObject*) list;
2190  Py_ssize_t len = Py_SIZE(list);
2191  if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
2192  Py_INCREF(x);
2193  PyList_SET_ITEM(list, len, x);
2194  Py_SIZE(list) = len+1;
2195  return 0;
2196  }
2197  return PyList_Append(list, x);
2198 }
2199 #else
2200 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2201 #endif
2202 
2203 /* None.proto */
2204 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
2205 
2206 /* None.proto */
2207 static CYTHON_INLINE long __Pyx_div_long(long, long);
2208 
2209 /* PyObject_GenericGetAttrNoDict.proto */
2210 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2211 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2212 #else
2213 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2214 #endif
2215 
2216 /* PyObject_GenericGetAttr.proto */
2217 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2218 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2219 #else
2220 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2221 #endif
2222 
2223 /* SetupReduce.proto */
2224 static int __Pyx_setup_reduce(PyObject* type_obj);
2225 
2226 /* SetVTable.proto */
2227 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
2228 
2229 /* TypeImport.proto */
2230 #ifndef __PYX_HAVE_RT_ImportType_proto
2231 #define __PYX_HAVE_RT_ImportType_proto
2232 enum __Pyx_ImportType_CheckSize {
2233  __Pyx_ImportType_CheckSize_Error = 0,
2234  __Pyx_ImportType_CheckSize_Warn = 1,
2235  __Pyx_ImportType_CheckSize_Ignore = 2
2236 };
2237 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
2238 #endif
2239 
2240 /* CLineInTraceback.proto */
2241 #ifdef CYTHON_CLINE_IN_TRACEBACK
2242 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2243 #else
2244 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2245 #endif
2246 
2247 /* CodeObjectCache.proto */
2248 typedef struct {
2249  PyCodeObject* code_object;
2250  int code_line;
2251 } __Pyx_CodeObjectCacheEntry;
2252 struct __Pyx_CodeObjectCache {
2253  int count;
2254  int max_count;
2255  __Pyx_CodeObjectCacheEntry* entries;
2256 };
2257 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2258 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2259 static PyCodeObject *__pyx_find_code_object(int code_line);
2260 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2261 
2262 /* AddTraceback.proto */
2263 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2264  int py_line, const char *filename);
2265 
2266 #if PY_MAJOR_VERSION < 3
2267  static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2268  static void __Pyx_ReleaseBuffer(Py_buffer *view);
2269 #else
2270  #define __Pyx_GetBuffer PyObject_GetBuffer
2271  #define __Pyx_ReleaseBuffer PyBuffer_Release
2272 #endif
2273 
2274 
2275 /* BufferStructDeclare.proto */
2276 typedef struct {
2277  Py_ssize_t shape, strides, suboffsets;
2278 } __Pyx_Buf_DimInfo;
2279 typedef struct {
2280  size_t refcount;
2281  Py_buffer pybuffer;
2282 } __Pyx_Buffer;
2283 typedef struct {
2284  __Pyx_Buffer *rcbuffer;
2285  char *data;
2286  __Pyx_Buf_DimInfo diminfo[8];
2287 } __Pyx_LocalBuf_ND;
2288 
2289 /* MemviewSliceIsContig.proto */
2290 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2291 
2292 /* OverlappingSlices.proto */
2293 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2294  __Pyx_memviewslice *slice2,
2295  int ndim, size_t itemsize);
2296 
2297 /* Capsule.proto */
2298 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2299 
2300 /* MemviewDtypeToObject.proto */
2301 static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp);
2302 static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj);
2303 
2304 /* IsLittleEndian.proto */
2305 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2306 
2307 /* BufferFormatCheck.proto */
2308 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2309 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2310  __Pyx_BufFmt_StackElem* stack,
2311  __Pyx_TypeInfo* type);
2312 
2313 /* TypeInfoCompare.proto */
2314 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2315 
2316 /* MemviewSliceValidateAndInit.proto */
2317 static int __Pyx_ValidateAndInit_memviewslice(
2318  int *axes_specs,
2319  int c_or_f_flag,
2320  int buf_flags,
2321  int ndim,
2322  __Pyx_TypeInfo *dtype,
2323  __Pyx_BufFmt_StackElem stack[],
2324  __Pyx_memviewslice *memviewslice,
2325  PyObject *original_obj);
2326 
2327 /* ObjectToMemviewSlice.proto */
2328 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *, int writable_flag);
2329 
2330 /* CIntToPy.proto */
2331 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2332 
2333 /* CIntToPy.proto */
2334 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2335 
2336 /* RealImag.proto */
2337 #if CYTHON_CCOMPLEX
2338  #ifdef __cplusplus
2339  #define __Pyx_CREAL(z) ((z).real())
2340  #define __Pyx_CIMAG(z) ((z).imag())
2341  #else
2342  #define __Pyx_CREAL(z) (__real__(z))
2343  #define __Pyx_CIMAG(z) (__imag__(z))
2344  #endif
2345 #else
2346  #define __Pyx_CREAL(z) ((z).real)
2347  #define __Pyx_CIMAG(z) ((z).imag)
2348 #endif
2349 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2350  && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2351  #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2352  #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2353 #else
2354  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2355  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2356 #endif
2357 
2358 /* Arithmetic.proto */
2359 #if CYTHON_CCOMPLEX
2360  #define __Pyx_c_eq_float(a, b) ((a)==(b))
2361  #define __Pyx_c_sum_float(a, b) ((a)+(b))
2362  #define __Pyx_c_diff_float(a, b) ((a)-(b))
2363  #define __Pyx_c_prod_float(a, b) ((a)*(b))
2364  #define __Pyx_c_quot_float(a, b) ((a)/(b))
2365  #define __Pyx_c_neg_float(a) (-(a))
2366  #ifdef __cplusplus
2367  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2368  #define __Pyx_c_conj_float(z) (::std::conj(z))
2369  #if 1
2370  #define __Pyx_c_abs_float(z) (::std::abs(z))
2371  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2372  #endif
2373  #else
2374  #define __Pyx_c_is_zero_float(z) ((z)==0)
2375  #define __Pyx_c_conj_float(z) (conjf(z))
2376  #if 1
2377  #define __Pyx_c_abs_float(z) (cabsf(z))
2378  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2379  #endif
2380  #endif
2381 #else
2382  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2383  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2384  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2385  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2386  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2387  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2388  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2389  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2390  #if 1
2391  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2392  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2393  #endif
2394 #endif
2395 
2396 /* Arithmetic.proto */
2397 #if CYTHON_CCOMPLEX
2398  #define __Pyx_c_eq_double(a, b) ((a)==(b))
2399  #define __Pyx_c_sum_double(a, b) ((a)+(b))
2400  #define __Pyx_c_diff_double(a, b) ((a)-(b))
2401  #define __Pyx_c_prod_double(a, b) ((a)*(b))
2402  #define __Pyx_c_quot_double(a, b) ((a)/(b))
2403  #define __Pyx_c_neg_double(a) (-(a))
2404  #ifdef __cplusplus
2405  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2406  #define __Pyx_c_conj_double(z) (::std::conj(z))
2407  #if 1
2408  #define __Pyx_c_abs_double(z) (::std::abs(z))
2409  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2410  #endif
2411  #else
2412  #define __Pyx_c_is_zero_double(z) ((z)==0)
2413  #define __Pyx_c_conj_double(z) (conj(z))
2414  #if 1
2415  #define __Pyx_c_abs_double(z) (cabs(z))
2416  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2417  #endif
2418  #endif
2419 #else
2420  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2421  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2422  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2423  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2424  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2425  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2426  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2427  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2428  #if 1
2429  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2430  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2431  #endif
2432 #endif
2433 
2434 /* CIntToPy.proto */
2435 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
2436 
2437 /* MemviewSliceCopyTemplate.proto */
2438 static __Pyx_memviewslice
2439 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2440  const char *mode, int ndim,
2441  size_t sizeof_dtype, int contig_flag,
2442  int dtype_is_object);
2443 
2444 /* CIntFromPy.proto */
2445 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2446 
2447 /* CIntFromPy.proto */
2448 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2449 
2450 /* CIntFromPy.proto */
2451 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2452 
2453 /* CheckBinaryVersion.proto */
2454 static int __Pyx_check_binary_version(void);
2455 
2456 /* InitStrings.proto */
2457 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2458 
2459 static void __pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
2460 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2461 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2462 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2463 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2464 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
2465 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2466 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2467 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2468 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2469 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2470 
2471 /* Module declarations from 'cython.view' */
2472 
2473 /* Module declarations from 'cython' */
2474 
2475 /* Module declarations from 'cpython.buffer' */
2476 
2477 /* Module declarations from 'libc.string' */
2478 
2479 /* Module declarations from 'libc.stdio' */
2480 
2481 /* Module declarations from '__builtin__' */
2482 
2483 /* Module declarations from 'cpython.type' */
2484 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2485 
2486 /* Module declarations from 'cpython' */
2487 
2488 /* Module declarations from 'cpython.object' */
2489 
2490 /* Module declarations from 'cpython.ref' */
2491 
2492 /* Module declarations from 'cpython.mem' */
2493 
2494 /* Module declarations from 'numpy' */
2495 
2496 /* Module declarations from 'numpy' */
2497 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2498 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2499 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2500 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2501 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2502 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
2503 
2504 /* Module declarations from 'BoundaryConditions' */
2505 static PyTypeObject *__pyx_ptype_18BoundaryConditions_BC_Base = 0;
2506 static PyTypeObject *__pyx_ptype_18BoundaryConditions_BoundaryCondition = 0;
2507 static PyTypeObject *__pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC = 0;
2508 static PyTypeObject *__pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = 0;
2509 static PyTypeObject *__pyx_ptype_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = 0;
2510 static PyTypeObject *__pyx_array_type = 0;
2511 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2512 static PyTypeObject *__pyx_memoryview_type = 0;
2513 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2514 static PyObject *generic = 0;
2515 static PyObject *strided = 0;
2516 static PyObject *indirect = 0;
2517 static PyObject *contiguous = 0;
2518 static PyObject *indirect_contiguous = 0;
2519 static int __pyx_memoryview_thread_locks_used;
2520 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2521 static PyObject *__pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(struct __pyx_obj_18BoundaryConditions_BC_Base *, PyObject *); /*proto*/
2522 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2523 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2524 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2525 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2526 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2527 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2528 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2529 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
2530 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2531 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2532 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2533 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2534 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2535 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2536 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2537 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2538 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2539 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2540 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2541 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2542 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2543 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2544 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2545 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2546 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2547 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2548 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2549 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2550 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2551 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2552 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2553 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2554 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2555 static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
2556 #define __Pyx_MODULE_NAME "BoundaryConditions"
2557 extern int __pyx_module_is_main_BoundaryConditions;
2558 int __pyx_module_is_main_BoundaryConditions = 0;
2559 
2560 /* Implementation of 'BoundaryConditions' */
2561 static PyObject *__pyx_builtin_sum;
2562 static PyObject *__pyx_builtin_TypeError;
2563 static PyObject *__pyx_builtin_ValueError;
2564 static PyObject *__pyx_builtin_range;
2565 static PyObject *__pyx_builtin_RuntimeError;
2566 static PyObject *__pyx_builtin_ImportError;
2567 static PyObject *__pyx_builtin_MemoryError;
2568 static PyObject *__pyx_builtin_enumerate;
2569 static PyObject *__pyx_builtin_Ellipsis;
2570 static PyObject *__pyx_builtin_id;
2571 static PyObject *__pyx_builtin_IndexError;
2572 static const char __pyx_k_O[] = "O";
2573 static const char __pyx_k_a[] = "a";
2574 static const char __pyx_k_c[] = "c";
2575 static const char __pyx_k_n[] = "n";
2576 static const char __pyx_k_t[] = "t";
2577 static const char __pyx_k_x[] = "x";
2578 static const char __pyx_k_a0[] = "a0";
2579 static const char __pyx_k_id[] = "id";
2580 static const char __pyx_k_nd[] = "nd";
2581 static const char __pyx_k_np[] = "np";
2582 static const char __pyx_k_t1[] = "t1";
2583 static const char __pyx_k_all[] = "__all__";
2584 static const char __pyx_k_b_i[] = "b_i";
2585 static const char __pyx_k_get[] = "get";
2586 static const char __pyx_k_new[] = "__new__";
2587 static const char __pyx_k_obj[] = "obj";
2588 static const char __pyx_k_sum[] = "sum";
2589 static const char __pyx_k_None[] = "None";
2590 static const char __pyx_k_b_or[] = "b_or";
2591 static const char __pyx_k_base[] = "base";
2592 static const char __pyx_k_dict[] = "__dict__";
2593 static const char __pyx_k_main[] = "__main__";
2594 static const char __pyx_k_mode[] = "mode";
2595 static const char __pyx_k_name[] = "name";
2596 static const char __pyx_k_ndim[] = "ndim";
2597 static const char __pyx_k_pack[] = "pack";
2598 static const char __pyx_k_self[] = "self";
2599 static const char __pyx_k_size[] = "size";
2600 static const char __pyx_k_step[] = "step";
2601 static const char __pyx_k_stop[] = "stop";
2602 static const char __pyx_k_test[] = "__test__";
2603 static const char __pyx_k_ASCII[] = "ASCII";
2604 static const char __pyx_k_class[] = "__class__";
2605 static const char __pyx_k_error[] = "error";
2606 static const char __pyx_k_flags[] = "flags";
2607 static const char __pyx_k_numpy[] = "numpy";
2608 static const char __pyx_k_range[] = "range";
2609 static const char __pyx_k_shape[] = "shape";
2610 static const char __pyx_k_start[] = "start";
2611 static const char __pyx_k_state[] = "state";
2612 static const char __pyx_k_value[] = "value";
2613 static const char __pyx_k_zeros[] = "zeros";
2614 static const char __pyx_k_Domain[] = "Domain";
2615 static const char __pyx_k_dict_2[] = "_dict";
2616 static const char __pyx_k_encode[] = "encode";
2617 static const char __pyx_k_format[] = "format";
2618 static const char __pyx_k_import[] = "__import__";
2619 static const char __pyx_k_name_2[] = "__name__";
2620 static const char __pyx_k_pickle[] = "pickle";
2621 static const char __pyx_k_reduce[] = "__reduce__";
2622 static const char __pyx_k_struct[] = "struct";
2623 static const char __pyx_k_unpack[] = "unpack";
2624 static const char __pyx_k_update[] = "update";
2625 static const char __pyx_k_BC_Base[] = "BC_Base";
2626 static const char __pyx_k_Context[] = "Context";
2627 static const char __pyx_k_context[] = "context";
2628 static const char __pyx_k_fortran[] = "fortran";
2629 static const char __pyx_k_memview[] = "memview";
2630 static const char __pyx_k_proteus[] = "proteus";
2631 static const char __pyx_k_resetBC[] = "resetBC";
2632 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2633 static const char __pyx_k_getstate[] = "__getstate__";
2634 static const char __pyx_k_itemsize[] = "itemsize";
2635 static const char __pyx_k_pyx_type[] = "__pyx_type";
2636 static const char __pyx_k_setstate[] = "__setstate__";
2637 static const char __pyx_k_TypeError[] = "TypeError";
2638 static const char __pyx_k_enumerate[] = "enumerate";
2639 static const char __pyx_k_pyx_state[] = "__pyx_state";
2640 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2641 static const char __pyx_k_IndexError[] = "IndexError";
2642 static const char __pyx_k_ValueError[] = "ValueError";
2643 static const char __pyx_k_getContext[] = "getContext";
2644 static const char __pyx_k_pyx_result[] = "__pyx_result";
2645 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2646 static const char __pyx_k_ImportError[] = "ImportError";
2647 static const char __pyx_k_MemoryError[] = "MemoryError";
2648 static const char __pyx_k_PickleError[] = "PickleError";
2649 static const char __pyx_k_init_cython[] = "init_cython";
2650 static const char __pyx_k_setLinearBC[] = "setLinearBC";
2651 static const char __pyx_k_RuntimeError[] = "RuntimeError";
2652 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2653 static const char __pyx_k_stringsource[] = "stringsource";
2654 static const char __pyx_k_use_setstate[] = "use_setstate";
2655 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2656 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2657 static const char __pyx_k_setConstantBC[] = "setConstantBC";
2658 static const char __pyx_k_setLinearRamp[] = "setLinearRamp";
2659 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2660 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2661 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2662 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2663 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2664 static const char __pyx_k_BoundaryCondition[] = "BoundaryCondition";
2665 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2666 static const char __pyx_k_BC_Base_getContext[] = "BC_Base.getContext";
2667 static const char __pyx_k_BoundaryConditions[] = "BoundaryConditions";
2668 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2669 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2670 static const char __pyx_k_pyx_unpickle_BC_Base[] = "__pyx_unpickle_BC_Base";
2671 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2672 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2673 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2674 static const char __pyx_k_BC_Base___reduce_cython[] = "BC_Base.__reduce_cython__";
2675 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2676 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2677 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2678 static const char __pyx_k_BC_Base___setstate_cython[] = "BC_Base.__setstate_cython__";
2679 static const char __pyx_k_BoundaryCondition_resetBC[] = "BoundaryCondition.resetBC";
2680 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
2681 static const char __pyx_k_setLinearBC_locals_lambda[] = "setLinearBC.<locals>.<lambda>";
2682 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
2683 static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
2684 static const char __pyx_k_setConstantBC_locals_lambda[] = "setConstantBC.<locals>.<lambda>";
2685 static const char __pyx_k_setLinearRamp_locals_lambda[] = "setLinearRamp.<locals>.<lambda>";
2686 static const char __pyx_k_BoundaryCondition_init_cython[] = "BoundaryCondition.init_cython";
2687 static const char __pyx_k_BoundaryCondition_setLinearBC[] = "BoundaryCondition.setLinearBC";
2688 static const char __pyx_k_proteus_BoundaryConditions_py[] = "proteus/BoundaryConditions.py";
2689 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
2690 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
2691 static const char __pyx_k_BoundaryCondition_setConstantBC[] = "BoundaryCondition.setConstantBC";
2692 static const char __pyx_k_BoundaryCondition_setLinearRamp[] = "BoundaryCondition.setLinearRamp";
2693 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2694 static const char __pyx_k_self_uuOfXT_cannot_be_converted[] = "self.uuOfXT cannot be converted to a Python object for pickling";
2695 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
2696 static const char __pyx_k_BoundaryCondition___reduce_cytho[] = "BoundaryCondition.__reduce_cython__";
2697 static const char __pyx_k_BoundaryCondition___setstate_cyt[] = "BoundaryCondition.__setstate_cython__";
2698 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
2699 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
2700 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
2701 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
2702 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
2703 static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
2704 static const char __pyx_k_Incompatible_checksums_s_vs_0x96[] = "Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))";
2705 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))";
2706 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
2707 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
2708 static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
2709 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
2710 static const char __pyx_k_Shape_or_nd_must_be_passed_to_BC[] = "Shape or nd must be passed to BC";
2711 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
2712 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
2713 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
2714 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2715 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2716 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
2717 static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
2718 static PyObject *__pyx_n_s_ASCII;
2719 static PyObject *__pyx_n_s_BC_Base;
2720 static PyObject *__pyx_n_s_BC_Base___reduce_cython;
2721 static PyObject *__pyx_n_s_BC_Base___setstate_cython;
2722 static PyObject *__pyx_n_s_BC_Base_getContext;
2723 static PyObject *__pyx_n_s_BoundaryCondition;
2724 static PyObject *__pyx_n_s_BoundaryCondition___reduce_cytho;
2725 static PyObject *__pyx_n_s_BoundaryCondition___setstate_cyt;
2726 static PyObject *__pyx_n_s_BoundaryCondition_init_cython;
2727 static PyObject *__pyx_n_s_BoundaryCondition_resetBC;
2728 static PyObject *__pyx_n_s_BoundaryCondition_setConstantBC;
2729 static PyObject *__pyx_n_s_BoundaryCondition_setLinearBC;
2730 static PyObject *__pyx_n_s_BoundaryCondition_setLinearRamp;
2731 static PyObject *__pyx_n_s_BoundaryConditions;
2732 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2733 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2734 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2735 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2736 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2737 static PyObject *__pyx_n_s_Context;
2738 static PyObject *__pyx_n_s_Domain;
2739 static PyObject *__pyx_n_s_Ellipsis;
2740 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2741 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
2742 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
2743 static PyObject *__pyx_n_s_ImportError;
2744 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x96;
2745 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
2746 static PyObject *__pyx_n_s_IndexError;
2747 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2748 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2749 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2750 static PyObject *__pyx_n_s_MemoryError;
2751 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2752 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2753 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
2754 static PyObject *__pyx_n_s_None;
2755 static PyObject *__pyx_n_b_O;
2756 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2757 static PyObject *__pyx_n_s_PickleError;
2758 static PyObject *__pyx_n_s_RuntimeError;
2759 static PyObject *__pyx_kp_s_Shape_or_nd_must_be_passed_to_BC;
2760 static PyObject *__pyx_n_s_TypeError;
2761 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2762 static PyObject *__pyx_n_s_ValueError;
2763 static PyObject *__pyx_n_s_View_MemoryView;
2764 static PyObject *__pyx_n_s_a;
2765 static PyObject *__pyx_n_s_a0;
2766 static PyObject *__pyx_n_s_all;
2767 static PyObject *__pyx_n_s_allocate_buffer;
2768 static PyObject *__pyx_n_s_b_i;
2769 static PyObject *__pyx_n_s_b_or;
2770 static PyObject *__pyx_n_s_base;
2771 static PyObject *__pyx_n_s_c;
2772 static PyObject *__pyx_n_u_c;
2773 static PyObject *__pyx_n_s_class;
2774 static PyObject *__pyx_n_s_cline_in_traceback;
2775 static PyObject *__pyx_n_s_context;
2776 static PyObject *__pyx_kp_s_contiguous_and_direct;
2777 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2778 static PyObject *__pyx_n_s_dict;
2779 static PyObject *__pyx_n_s_dict_2;
2780 static PyObject *__pyx_n_s_dtype_is_object;
2781 static PyObject *__pyx_n_s_encode;
2782 static PyObject *__pyx_n_s_enumerate;
2783 static PyObject *__pyx_n_s_error;
2784 static PyObject *__pyx_n_s_flags;
2785 static PyObject *__pyx_n_s_format;
2786 static PyObject *__pyx_n_s_fortran;
2787 static PyObject *__pyx_n_u_fortran;
2788 static PyObject *__pyx_n_s_get;
2789 static PyObject *__pyx_n_s_getContext;
2790 static PyObject *__pyx_n_s_getstate;
2791 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2792 static PyObject *__pyx_n_s_id;
2793 static PyObject *__pyx_n_s_import;
2794 static PyObject *__pyx_n_s_init_cython;
2795 static PyObject *__pyx_n_s_itemsize;
2796 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2797 static PyObject *__pyx_n_s_main;
2798 static PyObject *__pyx_n_s_memview;
2799 static PyObject *__pyx_n_s_mode;
2800 static PyObject *__pyx_n_s_n;
2801 static PyObject *__pyx_n_s_name;
2802 static PyObject *__pyx_n_s_name_2;
2803 static PyObject *__pyx_n_s_nd;
2804 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
2805 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
2806 static PyObject *__pyx_n_s_ndim;
2807 static PyObject *__pyx_n_s_new;
2808 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2809 static PyObject *__pyx_n_s_np;
2810 static PyObject *__pyx_n_s_numpy;
2811 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2812 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2813 static PyObject *__pyx_n_s_obj;
2814 static PyObject *__pyx_n_s_pack;
2815 static PyObject *__pyx_n_s_pickle;
2816 static PyObject *__pyx_n_s_proteus;
2817 static PyObject *__pyx_kp_s_proteus_BoundaryConditions_py;
2818 static PyObject *__pyx_n_s_pyx_PickleError;
2819 static PyObject *__pyx_n_s_pyx_checksum;
2820 static PyObject *__pyx_n_s_pyx_getbuffer;
2821 static PyObject *__pyx_n_s_pyx_result;
2822 static PyObject *__pyx_n_s_pyx_state;
2823 static PyObject *__pyx_n_s_pyx_type;
2824 static PyObject *__pyx_n_s_pyx_unpickle_BC_Base;
2825 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2826 static PyObject *__pyx_n_s_pyx_vtable;
2827 static PyObject *__pyx_n_s_range;
2828 static PyObject *__pyx_n_s_reduce;
2829 static PyObject *__pyx_n_s_reduce_cython;
2830 static PyObject *__pyx_n_s_reduce_ex;
2831 static PyObject *__pyx_n_s_resetBC;
2832 static PyObject *__pyx_n_s_self;
2833 static PyObject *__pyx_kp_s_self_uuOfXT_cannot_be_converted;
2834 static PyObject *__pyx_n_s_setConstantBC;
2835 static PyObject *__pyx_n_s_setConstantBC_locals_lambda;
2836 static PyObject *__pyx_n_s_setLinearBC;
2837 static PyObject *__pyx_n_s_setLinearBC_locals_lambda;
2838 static PyObject *__pyx_n_s_setLinearRamp;
2839 static PyObject *__pyx_n_s_setLinearRamp_locals_lambda;
2840 static PyObject *__pyx_n_s_setstate;
2841 static PyObject *__pyx_n_s_setstate_cython;
2842 static PyObject *__pyx_n_s_shape;
2843 static PyObject *__pyx_n_s_size;
2844 static PyObject *__pyx_n_s_start;
2845 static PyObject *__pyx_n_s_state;
2846 static PyObject *__pyx_n_s_step;
2847 static PyObject *__pyx_n_s_stop;
2848 static PyObject *__pyx_kp_s_strided_and_direct;
2849 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2850 static PyObject *__pyx_kp_s_strided_and_indirect;
2851 static PyObject *__pyx_kp_s_stringsource;
2852 static PyObject *__pyx_n_s_struct;
2853 static PyObject *__pyx_n_s_sum;
2854 static PyObject *__pyx_n_s_t;
2855 static PyObject *__pyx_n_s_t1;
2856 static PyObject *__pyx_n_s_test;
2857 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2858 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2859 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
2860 static PyObject *__pyx_n_s_unpack;
2861 static PyObject *__pyx_n_s_update;
2862 static PyObject *__pyx_n_s_use_setstate;
2863 static PyObject *__pyx_n_s_value;
2864 static PyObject *__pyx_n_s_x;
2865 static PyObject *__pyx_n_s_zeros;
2866 static int __pyx_pf_18BoundaryConditions_7BC_Base___init__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_name, PyObject *__pyx_v_b_or, PyObject *__pyx_v_b_i, PyObject *__pyx_v_nd); /* proto */
2867 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2getContext(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_context); /* proto */
2868 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2869 static int __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2870 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2871 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2872 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2873 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2874 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2875 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2876 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2877 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2878 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2879 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2880 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2881 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2882 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2883 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2884 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
2885 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
2886 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
2887 static PyObject *__pyx_pf_18BoundaryConditions_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
2888 static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n); /* proto */
2889 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2890 static PyObject *__pyx_pf_18BoundaryConditions_4__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
2891 static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n); /* proto */
2892 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_a0, PyObject *__pyx_v_a); /* proto */
2893 static PyObject *__pyx_pf_18BoundaryConditions_6__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
2894 static PyObject *__pyx_lambda_funcdef_lambda2(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n); /* proto */
2895 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_10setLinearRamp(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_t1, PyObject *__pyx_v_value); /* proto */
2896 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
2897 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2898 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
2899 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
2900 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2901 static PyObject *__pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2902 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2903 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
2904 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
2905 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2906 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2907 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2908 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2909 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
2910 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
2911 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
2912 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
2913 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2914 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
2915 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2916 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2917 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2918 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
2919 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2920 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
2921 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
2922 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2923 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2924 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2925 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2926 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2927 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2928 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2929 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2930 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2931 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2932 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2933 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2934 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2935 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2936 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2937 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2938 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2939 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2940 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2941 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2942 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2943 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2944 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2945 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2946 static PyObject *__pyx_tp_new_18BoundaryConditions_BC_Base(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2947 static PyObject *__pyx_tp_new_18BoundaryConditions_BoundaryCondition(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2948 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2949 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2950 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2951 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2952 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2953 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2954 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2955 static PyObject *__pyx_int_0;
2956 static PyObject *__pyx_int_1;
2957 static PyObject *__pyx_int_3;
2958 static PyObject *__pyx_int_158231071;
2959 static PyObject *__pyx_int_184977713;
2960 static PyObject *__pyx_int_neg_1;
2961 static PyObject *__pyx_codeobj_;
2962 static PyObject *__pyx_slice__7;
2963 static PyObject *__pyx_tuple__11;
2964 static PyObject *__pyx_tuple__13;
2965 static PyObject *__pyx_tuple__15;
2966 static PyObject *__pyx_tuple__16;
2967 static PyObject *__pyx_tuple__17;
2968 static PyObject *__pyx_tuple__18;
2969 static PyObject *__pyx_tuple__19;
2970 static PyObject *__pyx_tuple__20;
2971 static PyObject *__pyx_tuple__21;
2972 static PyObject *__pyx_tuple__22;
2973 static PyObject *__pyx_tuple__23;
2974 static PyObject *__pyx_tuple__24;
2975 static PyObject *__pyx_tuple__25;
2976 static PyObject *__pyx_tuple__26;
2977 static PyObject *__pyx_tuple__27;
2978 static PyObject *__pyx_tuple__28;
2979 static PyObject *__pyx_tuple__29;
2980 static PyObject *__pyx_tuple__30;
2981 static PyObject *__pyx_tuple__31;
2982 static PyObject *__pyx_tuple__32;
2983 static PyObject *__pyx_tuple__33;
2984 static PyObject *__pyx_tuple__34;
2985 static PyObject *__pyx_tuple__35;
2986 static PyObject *__pyx_tuple__36;
2987 static PyObject *__pyx_tuple__37;
2988 static PyObject *__pyx_tuple__38;
2989 static PyObject *__pyx_tuple__40;
2990 static PyObject *__pyx_tuple__41;
2991 static PyObject *__pyx_tuple__42;
2992 static PyObject *__pyx_tuple__43;
2993 static PyObject *__pyx_tuple__44;
2994 static PyObject *__pyx_tuple__45;
2995 static PyObject *__pyx_tuple__46;
2996 static PyObject *__pyx_tuple__47;
2997 static PyObject *__pyx_tuple__48;
2998 static PyObject *__pyx_tuple__49;
2999 static PyObject *__pyx_tuple__50;
3000 static PyObject *__pyx_tuple__51;
3001 static PyObject *__pyx_tuple__52;
3002 static PyObject *__pyx_tuple__53;
3003 static PyObject *__pyx_tuple__54;
3004 static PyObject *__pyx_tuple__55;
3005 static PyObject *__pyx_tuple__56;
3006 static PyObject *__pyx_codeobj__2;
3007 static PyObject *__pyx_codeobj__3;
3008 static PyObject *__pyx_codeobj__4;
3009 static PyObject *__pyx_codeobj__5;
3010 static PyObject *__pyx_codeobj__6;
3011 static PyObject *__pyx_codeobj__8;
3012 static PyObject *__pyx_codeobj__9;
3013 static PyObject *__pyx_codeobj__10;
3014 static PyObject *__pyx_codeobj__12;
3015 static PyObject *__pyx_codeobj__14;
3016 static PyObject *__pyx_codeobj__39;
3017 /* Late includes */
3018 
3019 /* "BoundaryConditions.py":24
3020  * Generic class regrouping boundary conditions
3021  * """
3022  * def __init__(self, shape=None, name=None, b_or=None, b_i=0, nd=None): # <<<<<<<<<<<<<<
3023  * self.Shape = shape
3024  * self.name = name
3025  */
3026 
3027 /* Python wrapper */
3028 static int __pyx_pw_18BoundaryConditions_7BC_Base_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3029 static int __pyx_pw_18BoundaryConditions_7BC_Base_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3030  PyObject *__pyx_v_shape = 0;
3031  PyObject *__pyx_v_name = 0;
3032  PyObject *__pyx_v_b_or = 0;
3033  PyObject *__pyx_v_b_i = 0;
3034  PyObject *__pyx_v_nd = 0;
3035  int __pyx_r;
3036  __Pyx_RefNannyDeclarations
3037  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
3038  {
3039  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_name,&__pyx_n_s_b_or,&__pyx_n_s_b_i,&__pyx_n_s_nd,0};
3040  PyObject* values[5] = {0,0,0,0,0};
3041  values[0] = ((PyObject *)Py_None);
3042  values[1] = ((PyObject *)Py_None);
3043  values[2] = ((PyObject *)Py_None);
3044  values[3] = ((PyObject *)__pyx_int_0);
3045  values[4] = ((PyObject *)Py_None);
3046  if (unlikely(__pyx_kwds)) {
3047  Py_ssize_t kw_args;
3048  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3049  switch (pos_args) {
3050  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3051  CYTHON_FALLTHROUGH;
3052  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3053  CYTHON_FALLTHROUGH;
3054  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3055  CYTHON_FALLTHROUGH;
3056  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3057  CYTHON_FALLTHROUGH;
3058  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3059  CYTHON_FALLTHROUGH;
3060  case 0: break;
3061  default: goto __pyx_L5_argtuple_error;
3062  }
3063  kw_args = PyDict_Size(__pyx_kwds);
3064  switch (pos_args) {
3065  case 0:
3066  if (kw_args > 0) {
3067  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape);
3068  if (value) { values[0] = value; kw_args--; }
3069  }
3070  CYTHON_FALLTHROUGH;
3071  case 1:
3072  if (kw_args > 0) {
3073  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
3074  if (value) { values[1] = value; kw_args--; }
3075  }
3076  CYTHON_FALLTHROUGH;
3077  case 2:
3078  if (kw_args > 0) {
3079  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b_or);
3080  if (value) { values[2] = value; kw_args--; }
3081  }
3082  CYTHON_FALLTHROUGH;
3083  case 3:
3084  if (kw_args > 0) {
3085  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b_i);
3086  if (value) { values[3] = value; kw_args--; }
3087  }
3088  CYTHON_FALLTHROUGH;
3089  case 4:
3090  if (kw_args > 0) {
3091  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd);
3092  if (value) { values[4] = value; kw_args--; }
3093  }
3094  }
3095  if (unlikely(kw_args > 0)) {
3096  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 24, __pyx_L3_error)
3097  }
3098  } else {
3099  switch (PyTuple_GET_SIZE(__pyx_args)) {
3100  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3101  CYTHON_FALLTHROUGH;
3102  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3103  CYTHON_FALLTHROUGH;
3104  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3105  CYTHON_FALLTHROUGH;
3106  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3107  CYTHON_FALLTHROUGH;
3108  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3109  CYTHON_FALLTHROUGH;
3110  case 0: break;
3111  default: goto __pyx_L5_argtuple_error;
3112  }
3113  }
3114  __pyx_v_shape = values[0];
3115  __pyx_v_name = values[1];
3116  __pyx_v_b_or = values[2];
3117  __pyx_v_b_i = values[3];
3118  __pyx_v_nd = values[4];
3119  }
3120  goto __pyx_L4_argument_unpacking_done;
3121  __pyx_L5_argtuple_error:;
3122  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 24, __pyx_L3_error)
3123  __pyx_L3_error:;
3124  __Pyx_AddTraceback("BoundaryConditions.BC_Base.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3125  __Pyx_RefNannyFinishContext();
3126  return -1;
3127  __pyx_L4_argument_unpacking_done:;
3128  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base___init__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), __pyx_v_shape, __pyx_v_name, __pyx_v_b_or, __pyx_v_b_i, __pyx_v_nd);
3129 
3130  /* function exit code */
3131  __Pyx_RefNannyFinishContext();
3132  return __pyx_r;
3133 }
3134 
3135 static int __pyx_pf_18BoundaryConditions_7BC_Base___init__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_name, PyObject *__pyx_v_b_or, PyObject *__pyx_v_b_i, PyObject *__pyx_v_nd) {
3136  int __pyx_r;
3137  __Pyx_TraceDeclarations
3138  __Pyx_RefNannyDeclarations
3139  PyObject *__pyx_t_1 = NULL;
3140  int __pyx_t_2;
3141  int __pyx_t_3;
3142  PyObject *__pyx_t_4 = NULL;
3143  int __pyx_t_5;
3144  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
3145  __Pyx_RefNannySetupContext("__init__", 0);
3146  __Pyx_TraceCall("__init__", __pyx_f[0], 24, 0, __PYX_ERR(0, 24, __pyx_L1_error));
3147 
3148  /* "BoundaryConditions.py":25
3149  * """
3150  * def __init__(self, shape=None, name=None, b_or=None, b_i=0, nd=None):
3151  * self.Shape = shape # <<<<<<<<<<<<<<
3152  * self.name = name
3153  * self.BC_type = 'None'
3154  */
3155  __Pyx_INCREF(__pyx_v_shape);
3156  __Pyx_GIVEREF(__pyx_v_shape);
3157  __Pyx_GOTREF(__pyx_v_self->Shape);
3158  __Pyx_DECREF(__pyx_v_self->Shape);
3159  __pyx_v_self->Shape = __pyx_v_shape;
3160 
3161  /* "BoundaryConditions.py":26
3162  * def __init__(self, shape=None, name=None, b_or=None, b_i=0, nd=None):
3163  * self.Shape = shape
3164  * self.name = name # <<<<<<<<<<<<<<
3165  * self.BC_type = 'None'
3166  * if shape is not None:
3167  */
3168  if (!(likely(PyString_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_name)->tp_name), 0))) __PYX_ERR(0, 26, __pyx_L1_error)
3169  __pyx_t_1 = __pyx_v_name;
3170  __Pyx_INCREF(__pyx_t_1);
3171  __Pyx_GIVEREF(__pyx_t_1);
3172  __Pyx_GOTREF(__pyx_v_self->name);
3173  __Pyx_DECREF(__pyx_v_self->name);
3174  __pyx_v_self->name = ((PyObject*)__pyx_t_1);
3175  __pyx_t_1 = 0;
3176 
3177  /* "BoundaryConditions.py":27
3178  * self.Shape = shape
3179  * self.name = name
3180  * self.BC_type = 'None' # <<<<<<<<<<<<<<
3181  * if shape is not None:
3182  * self.nd = self.Shape.Domain.nd
3183  */
3184  __Pyx_INCREF(__pyx_n_s_None);
3185  __Pyx_GIVEREF(__pyx_n_s_None);
3186  __Pyx_GOTREF(__pyx_v_self->BC_type);
3187  __Pyx_DECREF(__pyx_v_self->BC_type);
3188  __pyx_v_self->BC_type = __pyx_n_s_None;
3189 
3190  /* "BoundaryConditions.py":28
3191  * self.name = name
3192  * self.BC_type = 'None'
3193  * if shape is not None: # <<<<<<<<<<<<<<
3194  * self.nd = self.Shape.Domain.nd
3195  * elif nd is not None:
3196  */
3197  __pyx_t_2 = (__pyx_v_shape != Py_None);
3198  __pyx_t_3 = (__pyx_t_2 != 0);
3199  if (__pyx_t_3) {
3200 
3201  /* "BoundaryConditions.py":29
3202  * self.BC_type = 'None'
3203  * if shape is not None:
3204  * self.nd = self.Shape.Domain.nd # <<<<<<<<<<<<<<
3205  * elif nd is not None:
3206  * self.nd = nd
3207  */
3208  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->Shape, __pyx_n_s_Domain); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
3209  __Pyx_GOTREF(__pyx_t_1);
3210  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nd); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error)
3211  __Pyx_GOTREF(__pyx_t_4);
3212  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3213  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 29, __pyx_L1_error)
3214  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3215  __pyx_v_self->nd = __pyx_t_5;
3216 
3217  /* "BoundaryConditions.py":28
3218  * self.name = name
3219  * self.BC_type = 'None'
3220  * if shape is not None: # <<<<<<<<<<<<<<
3221  * self.nd = self.Shape.Domain.nd
3222  * elif nd is not None:
3223  */
3224  goto __pyx_L3;
3225  }
3226 
3227  /* "BoundaryConditions.py":30
3228  * if shape is not None:
3229  * self.nd = self.Shape.Domain.nd
3230  * elif nd is not None: # <<<<<<<<<<<<<<
3231  * self.nd = nd
3232  * else:
3233  */
3234  __pyx_t_3 = (__pyx_v_nd != Py_None);
3235  __pyx_t_2 = (__pyx_t_3 != 0);
3236  if (__pyx_t_2) {
3237 
3238  /* "BoundaryConditions.py":31
3239  * self.nd = self.Shape.Domain.nd
3240  * elif nd is not None:
3241  * self.nd = nd # <<<<<<<<<<<<<<
3242  * else:
3243  * assert nd is not None, 'Shape or nd must be passed to BC'
3244  */
3245  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_nd); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L1_error)
3246  __pyx_v_self->nd = __pyx_t_5;
3247 
3248  /* "BoundaryConditions.py":30
3249  * if shape is not None:
3250  * self.nd = self.Shape.Domain.nd
3251  * elif nd is not None: # <<<<<<<<<<<<<<
3252  * self.nd = nd
3253  * else:
3254  */
3255  goto __pyx_L3;
3256  }
3257 
3258  /* "BoundaryConditions.py":33
3259  * self.nd = nd
3260  * else:
3261  * assert nd is not None, 'Shape or nd must be passed to BC' # <<<<<<<<<<<<<<
3262  * if b_or is not None:
3263  * self._b_or = b_or[b_i] # array of orientation of all boundaries of shape
3264  */
3265  /*else*/ {
3266  #ifndef CYTHON_WITHOUT_ASSERTIONS
3267  if (unlikely(!Py_OptimizeFlag)) {
3268  __pyx_t_2 = (__pyx_v_nd != Py_None);
3269  if (unlikely(!(__pyx_t_2 != 0))) {
3270  PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_Shape_or_nd_must_be_passed_to_BC);
3271  __PYX_ERR(0, 33, __pyx_L1_error)
3272  }
3273  }
3274  #endif
3275  }
3276  __pyx_L3:;
3277 
3278  /* "BoundaryConditions.py":34
3279  * else:
3280  * assert nd is not None, 'Shape or nd must be passed to BC'
3281  * if b_or is not None: # <<<<<<<<<<<<<<
3282  * self._b_or = b_or[b_i] # array of orientation of all boundaries of shape
3283  * else:
3284  */
3285  __pyx_t_2 = (__pyx_v_b_or != Py_None);
3286  __pyx_t_3 = (__pyx_t_2 != 0);
3287  if (__pyx_t_3) {
3288 
3289  /* "BoundaryConditions.py":35
3290  * assert nd is not None, 'Shape or nd must be passed to BC'
3291  * if b_or is not None:
3292  * self._b_or = b_or[b_i] # array of orientation of all boundaries of shape # <<<<<<<<<<<<<<
3293  * else:
3294  * self._b_or = None
3295  */
3296  __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_b_or, __pyx_v_b_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 35, __pyx_L1_error)
3297  __Pyx_GOTREF(__pyx_t_4);
3298  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 35, __pyx_L1_error)
3299  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3300  __PYX_XDEC_MEMVIEW(&__pyx_v_self->_b_or, 0);
3301  __pyx_v_self->_b_or = __pyx_t_6;
3302  __pyx_t_6.memview = NULL;
3303  __pyx_t_6.data = NULL;
3304 
3305  /* "BoundaryConditions.py":34
3306  * else:
3307  * assert nd is not None, 'Shape or nd must be passed to BC'
3308  * if b_or is not None: # <<<<<<<<<<<<<<
3309  * self._b_or = b_or[b_i] # array of orientation of all boundaries of shape
3310  * else:
3311  */
3312  goto __pyx_L4;
3313  }
3314 
3315  /* "BoundaryConditions.py":37
3316  * self._b_or = b_or[b_i] # array of orientation of all boundaries of shape
3317  * else:
3318  * self._b_or = None # <<<<<<<<<<<<<<
3319  *
3320  * # @staticmethod
3321  */
3322  /*else*/ {
3323  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 37, __pyx_L1_error)
3324  __PYX_XDEC_MEMVIEW(&__pyx_v_self->_b_or, 0);
3325  __pyx_v_self->_b_or = __pyx_t_6;
3326  __pyx_t_6.memview = NULL;
3327  __pyx_t_6.data = NULL;
3328  }
3329  __pyx_L4:;
3330 
3331  /* "BoundaryConditions.py":24
3332  * Generic class regrouping boundary conditions
3333  * """
3334  * def __init__(self, shape=None, name=None, b_or=None, b_i=0, nd=None): # <<<<<<<<<<<<<<
3335  * self.Shape = shape
3336  * self.name = name
3337  */
3338 
3339  /* function exit code */
3340  __pyx_r = 0;
3341  goto __pyx_L0;
3342  __pyx_L1_error:;
3343  __Pyx_XDECREF(__pyx_t_1);
3344  __Pyx_XDECREF(__pyx_t_4);
3345  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
3346  __Pyx_AddTraceback("BoundaryConditions.BC_Base.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3347  __pyx_r = -1;
3348  __pyx_L0:;
3349  __Pyx_TraceReturn(Py_None, 0);
3350  __Pyx_RefNannyFinishContext();
3351  return __pyx_r;
3352 }
3353 
3354 /* "BoundaryConditions.py":52
3355  * # setattr(BC_Base, name, default_value)
3356  *
3357  * def getContext(self, context=None): # <<<<<<<<<<<<<<
3358  * """
3359  * Gets context from proteus.Context or
3360  */
3361 
3362 /* Python wrapper */
3363 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_3getContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3364 static char __pyx_doc_18BoundaryConditions_7BC_Base_2getContext[] = "BC_Base.getContext(self, context=None)\n\n Gets context from proteus.Context or\n\n Parameters\n ----------\n context: class, optional\n if set to None, the context will be created from proteus.Context\n ";
3365 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_3getContext = {"getContext", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_7BC_Base_3getContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_7BC_Base_2getContext};
3366 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_3getContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3367  PyObject *__pyx_v_context = 0;
3368  PyObject *__pyx_r = 0;
3369  __Pyx_RefNannyDeclarations
3370  __Pyx_RefNannySetupContext("getContext (wrapper)", 0);
3371  {
3372  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,0};
3373  PyObject* values[1] = {0};
3374  values[0] = ((PyObject *)Py_None);
3375  if (unlikely(__pyx_kwds)) {
3376  Py_ssize_t kw_args;
3377  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3378  switch (pos_args) {
3379  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3380  CYTHON_FALLTHROUGH;
3381  case 0: break;
3382  default: goto __pyx_L5_argtuple_error;
3383  }
3384  kw_args = PyDict_Size(__pyx_kwds);
3385  switch (pos_args) {
3386  case 0:
3387  if (kw_args > 0) {
3388  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context);
3389  if (value) { values[0] = value; kw_args--; }
3390  }
3391  }
3392  if (unlikely(kw_args > 0)) {
3393  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getContext") < 0)) __PYX_ERR(0, 52, __pyx_L3_error)
3394  }
3395  } else {
3396  switch (PyTuple_GET_SIZE(__pyx_args)) {
3397  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3398  CYTHON_FALLTHROUGH;
3399  case 0: break;
3400  default: goto __pyx_L5_argtuple_error;
3401  }
3402  }
3403  __pyx_v_context = values[0];
3404  }
3405  goto __pyx_L4_argument_unpacking_done;
3406  __pyx_L5_argtuple_error:;
3407  __Pyx_RaiseArgtupleInvalid("getContext", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 52, __pyx_L3_error)
3408  __pyx_L3_error:;
3409  __Pyx_AddTraceback("BoundaryConditions.BC_Base.getContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
3410  __Pyx_RefNannyFinishContext();
3411  return NULL;
3412  __pyx_L4_argument_unpacking_done:;
3413  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2getContext(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), __pyx_v_context);
3414 
3415  /* function exit code */
3416  __Pyx_RefNannyFinishContext();
3417  return __pyx_r;
3418 }
3419 
3420 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2getContext(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_context) {
3421  PyObject *__pyx_v_Context = NULL;
3422  PyObject *__pyx_r = NULL;
3423  __Pyx_TraceDeclarations
3424  __Pyx_RefNannyDeclarations
3425  int __pyx_t_1;
3426  PyObject *__pyx_t_2 = NULL;
3427  PyObject *__pyx_t_3 = NULL;
3428  PyObject *__pyx_t_4 = NULL;
3429  __Pyx_TraceFrameInit(__pyx_codeobj_)
3430  __Pyx_RefNannySetupContext("getContext", 0);
3431  __Pyx_TraceCall("getContext", __pyx_f[0], 52, 0, __PYX_ERR(0, 52, __pyx_L1_error));
3432 
3433  /* "BoundaryConditions.py":61
3434  * if set to None, the context will be created from proteus.Context
3435  * """
3436  * if context: # <<<<<<<<<<<<<<
3437  * from proteus import Context
3438  * self.ct = Context.get()
3439  */
3440  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_context); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 61, __pyx_L1_error)
3441  if (__pyx_t_1) {
3442 
3443  /* "BoundaryConditions.py":62
3444  * """
3445  * if context:
3446  * from proteus import Context # <<<<<<<<<<<<<<
3447  * self.ct = Context.get()
3448  * else:
3449  */
3450  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
3451  __Pyx_GOTREF(__pyx_t_2);
3452  __Pyx_INCREF(__pyx_n_s_Context);
3453  __Pyx_GIVEREF(__pyx_n_s_Context);
3454  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Context);
3455  __pyx_t_3 = __Pyx_Import(__pyx_n_s_proteus, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error)
3456  __Pyx_GOTREF(__pyx_t_3);
3457  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3458  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Context); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
3459  __Pyx_GOTREF(__pyx_t_2);
3460  __Pyx_INCREF(__pyx_t_2);
3461  __pyx_v_Context = __pyx_t_2;
3462  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3463  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3464 
3465  /* "BoundaryConditions.py":63
3466  * if context:
3467  * from proteus import Context
3468  * self.ct = Context.get() # <<<<<<<<<<<<<<
3469  * else:
3470  * self.ct = context
3471  */
3472  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_Context, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
3473  __Pyx_GOTREF(__pyx_t_2);
3474  __pyx_t_4 = NULL;
3475  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3476  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
3477  if (likely(__pyx_t_4)) {
3478  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3479  __Pyx_INCREF(__pyx_t_4);
3480  __Pyx_INCREF(function);
3481  __Pyx_DECREF_SET(__pyx_t_2, function);
3482  }
3483  }
3484  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
3485  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3486  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 63, __pyx_L1_error)
3487  __Pyx_GOTREF(__pyx_t_3);
3488  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3489  __Pyx_GIVEREF(__pyx_t_3);
3490  __Pyx_GOTREF(__pyx_v_self->ct);
3491  __Pyx_DECREF(__pyx_v_self->ct);
3492  __pyx_v_self->ct = __pyx_t_3;
3493  __pyx_t_3 = 0;
3494 
3495  /* "BoundaryConditions.py":61
3496  * if set to None, the context will be created from proteus.Context
3497  * """
3498  * if context: # <<<<<<<<<<<<<<
3499  * from proteus import Context
3500  * self.ct = Context.get()
3501  */
3502  goto __pyx_L3;
3503  }
3504 
3505  /* "BoundaryConditions.py":65
3506  * self.ct = Context.get()
3507  * else:
3508  * self.ct = context # <<<<<<<<<<<<<<
3509  *
3510  *
3511  */
3512  /*else*/ {
3513  __Pyx_INCREF(__pyx_v_context);
3514  __Pyx_GIVEREF(__pyx_v_context);
3515  __Pyx_GOTREF(__pyx_v_self->ct);
3516  __Pyx_DECREF(__pyx_v_self->ct);
3517  __pyx_v_self->ct = __pyx_v_context;
3518  }
3519  __pyx_L3:;
3520 
3521  /* "BoundaryConditions.py":52
3522  * # setattr(BC_Base, name, default_value)
3523  *
3524  * def getContext(self, context=None): # <<<<<<<<<<<<<<
3525  * """
3526  * Gets context from proteus.Context or
3527  */
3528 
3529  /* function exit code */
3530  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3531  goto __pyx_L0;
3532  __pyx_L1_error:;
3533  __Pyx_XDECREF(__pyx_t_2);
3534  __Pyx_XDECREF(__pyx_t_3);
3535  __Pyx_XDECREF(__pyx_t_4);
3536  __Pyx_AddTraceback("BoundaryConditions.BC_Base.getContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
3537  __pyx_r = NULL;
3538  __pyx_L0:;
3539  __Pyx_XDECREF(__pyx_v_Context);
3540  __Pyx_XGIVEREF(__pyx_r);
3541  __Pyx_TraceReturn(__pyx_r, 0);
3542  __Pyx_RefNannyFinishContext();
3543  return __pyx_r;
3544 }
3545 
3546 /* "BoundaryConditions.pxd":8
3547  * cdef double[:] _b_or
3548  * cdef public:
3549  * cdef int nd # <<<<<<<<<<<<<<
3550  * object Shape
3551  * str name
3552  */
3553 
3554 /* Python wrapper */
3555 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(PyObject *__pyx_v_self); /*proto*/
3556 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(PyObject *__pyx_v_self) {
3557  PyObject *__pyx_r = 0;
3558  __Pyx_RefNannyDeclarations
3559  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3560  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3561 
3562  /* function exit code */
3563  __Pyx_RefNannyFinishContext();
3564  return __pyx_r;
3565 }
3566 
3567 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3568  PyObject *__pyx_r = NULL;
3569  __Pyx_TraceDeclarations
3570  __Pyx_RefNannyDeclarations
3571  PyObject *__pyx_t_1 = NULL;
3572  __Pyx_RefNannySetupContext("__get__", 0);
3573  __Pyx_TraceCall("__get__", __pyx_f[2], 8, 0, __PYX_ERR(2, 8, __pyx_L1_error));
3574  __Pyx_XDECREF(__pyx_r);
3575  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->nd); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
3576  __Pyx_GOTREF(__pyx_t_1);
3577  __pyx_r = __pyx_t_1;
3578  __pyx_t_1 = 0;
3579  goto __pyx_L0;
3580 
3581  /* function exit code */
3582  __pyx_L1_error:;
3583  __Pyx_XDECREF(__pyx_t_1);
3584  __Pyx_AddTraceback("BoundaryConditions.BC_Base.nd.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3585  __pyx_r = NULL;
3586  __pyx_L0:;
3587  __Pyx_XGIVEREF(__pyx_r);
3588  __Pyx_TraceReturn(__pyx_r, 0);
3589  __Pyx_RefNannyFinishContext();
3590  return __pyx_r;
3591 }
3592 
3593 /* Python wrapper */
3594 static int __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
3595 static int __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3596  int __pyx_r;
3597  __Pyx_RefNannyDeclarations
3598  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3599  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3600 
3601  /* function exit code */
3602  __Pyx_RefNannyFinishContext();
3603  return __pyx_r;
3604 }
3605 
3606 static int __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3607  int __pyx_r;
3608  __Pyx_TraceDeclarations
3609  __Pyx_RefNannyDeclarations
3610  int __pyx_t_1;
3611  __Pyx_RefNannySetupContext("__set__", 0);
3612  __Pyx_TraceCall("__set__", __pyx_f[2], 8, 0, __PYX_ERR(2, 8, __pyx_L1_error));
3613  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 8, __pyx_L1_error)
3614  __pyx_v_self->nd = __pyx_t_1;
3615 
3616  /* function exit code */
3617  __pyx_r = 0;
3618  goto __pyx_L0;
3619  __pyx_L1_error:;
3620  __Pyx_AddTraceback("BoundaryConditions.BC_Base.nd.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3621  __pyx_r = -1;
3622  __pyx_L0:;
3623  __Pyx_TraceReturn(Py_None, 0);
3624  __Pyx_RefNannyFinishContext();
3625  return __pyx_r;
3626 }
3627 
3628 /* "BoundaryConditions.pxd":9
3629  * cdef public:
3630  * cdef int nd
3631  * object Shape # <<<<<<<<<<<<<<
3632  * str name
3633  * str BC_type
3634  */
3635 
3636 /* Python wrapper */
3637 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(PyObject *__pyx_v_self); /*proto*/
3638 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(PyObject *__pyx_v_self) {
3639  PyObject *__pyx_r = 0;
3640  __Pyx_RefNannyDeclarations
3641  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3642  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3643 
3644  /* function exit code */
3645  __Pyx_RefNannyFinishContext();
3646  return __pyx_r;
3647 }
3648 
3649 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3650  PyObject *__pyx_r = NULL;
3651  __Pyx_TraceDeclarations
3652  __Pyx_RefNannyDeclarations
3653  __Pyx_RefNannySetupContext("__get__", 0);
3654  __Pyx_TraceCall("__get__", __pyx_f[2], 9, 0, __PYX_ERR(2, 9, __pyx_L1_error));
3655  __Pyx_XDECREF(__pyx_r);
3656  __Pyx_INCREF(__pyx_v_self->Shape);
3657  __pyx_r = __pyx_v_self->Shape;
3658  goto __pyx_L0;
3659 
3660  /* function exit code */
3661  __pyx_L1_error:;
3662  __Pyx_AddTraceback("BoundaryConditions.BC_Base.Shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3663  __pyx_r = NULL;
3664  __pyx_L0:;
3665  __Pyx_XGIVEREF(__pyx_r);
3666  __Pyx_TraceReturn(__pyx_r, 0);
3667  __Pyx_RefNannyFinishContext();
3668  return __pyx_r;
3669 }
3670 
3671 /* Python wrapper */
3672 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
3673 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3674  int __pyx_r;
3675  __Pyx_RefNannyDeclarations
3676  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3677  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3678 
3679  /* function exit code */
3680  __Pyx_RefNannyFinishContext();
3681  return __pyx_r;
3682 }
3683 
3684 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3685  int __pyx_r;
3686  __Pyx_TraceDeclarations
3687  __Pyx_RefNannyDeclarations
3688  __Pyx_RefNannySetupContext("__set__", 0);
3689  __Pyx_TraceCall("__set__", __pyx_f[2], 9, 0, __PYX_ERR(2, 9, __pyx_L1_error));
3690  __Pyx_INCREF(__pyx_v_value);
3691  __Pyx_GIVEREF(__pyx_v_value);
3692  __Pyx_GOTREF(__pyx_v_self->Shape);
3693  __Pyx_DECREF(__pyx_v_self->Shape);
3694  __pyx_v_self->Shape = __pyx_v_value;
3695 
3696  /* function exit code */
3697  __pyx_r = 0;
3698  goto __pyx_L0;
3699  __pyx_L1_error:;
3700  __Pyx_AddTraceback("BoundaryConditions.BC_Base.Shape.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3701  __pyx_r = -1;
3702  __pyx_L0:;
3703  __Pyx_TraceReturn(Py_None, 0);
3704  __Pyx_RefNannyFinishContext();
3705  return __pyx_r;
3706 }
3707 
3708 /* Python wrapper */
3709 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(PyObject *__pyx_v_self); /*proto*/
3710 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(PyObject *__pyx_v_self) {
3711  int __pyx_r;
3712  __Pyx_RefNannyDeclarations
3713  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
3714  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3715 
3716  /* function exit code */
3717  __Pyx_RefNannyFinishContext();
3718  return __pyx_r;
3719 }
3720 
3721 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3722  int __pyx_r;
3723  __Pyx_TraceDeclarations
3724  __Pyx_RefNannyDeclarations
3725  __Pyx_RefNannySetupContext("__del__", 0);
3726  __Pyx_TraceCall("__del__", __pyx_f[2], 9, 0, __PYX_ERR(2, 9, __pyx_L1_error));
3727  __Pyx_INCREF(Py_None);
3728  __Pyx_GIVEREF(Py_None);
3729  __Pyx_GOTREF(__pyx_v_self->Shape);
3730  __Pyx_DECREF(__pyx_v_self->Shape);
3731  __pyx_v_self->Shape = Py_None;
3732 
3733  /* function exit code */
3734  __pyx_r = 0;
3735  goto __pyx_L0;
3736  __pyx_L1_error:;
3737  __Pyx_AddTraceback("BoundaryConditions.BC_Base.Shape.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3738  __pyx_r = -1;
3739  __pyx_L0:;
3740  __Pyx_TraceReturn(Py_None, 0);
3741  __Pyx_RefNannyFinishContext();
3742  return __pyx_r;
3743 }
3744 
3745 /* "BoundaryConditions.pxd":10
3746  * cdef int nd
3747  * object Shape
3748  * str name # <<<<<<<<<<<<<<
3749  * str BC_type
3750  * object ct
3751  */
3752 
3753 /* Python wrapper */
3754 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
3755 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(PyObject *__pyx_v_self) {
3756  PyObject *__pyx_r = 0;
3757  __Pyx_RefNannyDeclarations
3758  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3759  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3760 
3761  /* function exit code */
3762  __Pyx_RefNannyFinishContext();
3763  return __pyx_r;
3764 }
3765 
3766 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3767  PyObject *__pyx_r = NULL;
3768  __Pyx_TraceDeclarations
3769  __Pyx_RefNannyDeclarations
3770  __Pyx_RefNannySetupContext("__get__", 0);
3771  __Pyx_TraceCall("__get__", __pyx_f[2], 10, 0, __PYX_ERR(2, 10, __pyx_L1_error));
3772  __Pyx_XDECREF(__pyx_r);
3773  __Pyx_INCREF(__pyx_v_self->name);
3774  __pyx_r = __pyx_v_self->name;
3775  goto __pyx_L0;
3776 
3777  /* function exit code */
3778  __pyx_L1_error:;
3779  __Pyx_AddTraceback("BoundaryConditions.BC_Base.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3780  __pyx_r = NULL;
3781  __pyx_L0:;
3782  __Pyx_XGIVEREF(__pyx_r);
3783  __Pyx_TraceReturn(__pyx_r, 0);
3784  __Pyx_RefNannyFinishContext();
3785  return __pyx_r;
3786 }
3787 
3788 /* Python wrapper */
3789 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
3790 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3791  int __pyx_r;
3792  __Pyx_RefNannyDeclarations
3793  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3794  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3795 
3796  /* function exit code */
3797  __Pyx_RefNannyFinishContext();
3798  return __pyx_r;
3799 }
3800 
3801 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3802  int __pyx_r;
3803  __Pyx_TraceDeclarations
3804  __Pyx_RefNannyDeclarations
3805  PyObject *__pyx_t_1 = NULL;
3806  __Pyx_RefNannySetupContext("__set__", 0);
3807  __Pyx_TraceCall("__set__", __pyx_f[2], 10, 0, __PYX_ERR(2, 10, __pyx_L1_error));
3808  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(2, 10, __pyx_L1_error)
3809  __pyx_t_1 = __pyx_v_value;
3810  __Pyx_INCREF(__pyx_t_1);
3811  __Pyx_GIVEREF(__pyx_t_1);
3812  __Pyx_GOTREF(__pyx_v_self->name);
3813  __Pyx_DECREF(__pyx_v_self->name);
3814  __pyx_v_self->name = ((PyObject*)__pyx_t_1);
3815  __pyx_t_1 = 0;
3816 
3817  /* function exit code */
3818  __pyx_r = 0;
3819  goto __pyx_L0;
3820  __pyx_L1_error:;
3821  __Pyx_XDECREF(__pyx_t_1);
3822  __Pyx_AddTraceback("BoundaryConditions.BC_Base.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3823  __pyx_r = -1;
3824  __pyx_L0:;
3825  __Pyx_TraceReturn(Py_None, 0);
3826  __Pyx_RefNannyFinishContext();
3827  return __pyx_r;
3828 }
3829 
3830 /* Python wrapper */
3831 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(PyObject *__pyx_v_self); /*proto*/
3832 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(PyObject *__pyx_v_self) {
3833  int __pyx_r;
3834  __Pyx_RefNannyDeclarations
3835  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
3836  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3837 
3838  /* function exit code */
3839  __Pyx_RefNannyFinishContext();
3840  return __pyx_r;
3841 }
3842 
3843 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3844  int __pyx_r;
3845  __Pyx_TraceDeclarations
3846  __Pyx_RefNannyDeclarations
3847  __Pyx_RefNannySetupContext("__del__", 0);
3848  __Pyx_TraceCall("__del__", __pyx_f[2], 10, 0, __PYX_ERR(2, 10, __pyx_L1_error));
3849  __Pyx_INCREF(Py_None);
3850  __Pyx_GIVEREF(Py_None);
3851  __Pyx_GOTREF(__pyx_v_self->name);
3852  __Pyx_DECREF(__pyx_v_self->name);
3853  __pyx_v_self->name = ((PyObject*)Py_None);
3854 
3855  /* function exit code */
3856  __pyx_r = 0;
3857  goto __pyx_L0;
3858  __pyx_L1_error:;
3859  __Pyx_AddTraceback("BoundaryConditions.BC_Base.name.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3860  __pyx_r = -1;
3861  __pyx_L0:;
3862  __Pyx_TraceReturn(Py_None, 0);
3863  __Pyx_RefNannyFinishContext();
3864  return __pyx_r;
3865 }
3866 
3867 /* "BoundaryConditions.pxd":11
3868  * object Shape
3869  * str name
3870  * str BC_type # <<<<<<<<<<<<<<
3871  * object ct
3872  * # cpdef void newGlobalBC(BC_Base cls, newstr name, object default_value)
3873  */
3874 
3875 /* Python wrapper */
3876 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(PyObject *__pyx_v_self); /*proto*/
3877 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(PyObject *__pyx_v_self) {
3878  PyObject *__pyx_r = 0;
3879  __Pyx_RefNannyDeclarations
3880  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3881  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3882 
3883  /* function exit code */
3884  __Pyx_RefNannyFinishContext();
3885  return __pyx_r;
3886 }
3887 
3888 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3889  PyObject *__pyx_r = NULL;
3890  __Pyx_TraceDeclarations
3891  __Pyx_RefNannyDeclarations
3892  __Pyx_RefNannySetupContext("__get__", 0);
3893  __Pyx_TraceCall("__get__", __pyx_f[2], 11, 0, __PYX_ERR(2, 11, __pyx_L1_error));
3894  __Pyx_XDECREF(__pyx_r);
3895  __Pyx_INCREF(__pyx_v_self->BC_type);
3896  __pyx_r = __pyx_v_self->BC_type;
3897  goto __pyx_L0;
3898 
3899  /* function exit code */
3900  __pyx_L1_error:;
3901  __Pyx_AddTraceback("BoundaryConditions.BC_Base.BC_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3902  __pyx_r = NULL;
3903  __pyx_L0:;
3904  __Pyx_XGIVEREF(__pyx_r);
3905  __Pyx_TraceReturn(__pyx_r, 0);
3906  __Pyx_RefNannyFinishContext();
3907  return __pyx_r;
3908 }
3909 
3910 /* Python wrapper */
3911 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
3912 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3913  int __pyx_r;
3914  __Pyx_RefNannyDeclarations
3915  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3916  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3917 
3918  /* function exit code */
3919  __Pyx_RefNannyFinishContext();
3920  return __pyx_r;
3921 }
3922 
3923 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3924  int __pyx_r;
3925  __Pyx_TraceDeclarations
3926  __Pyx_RefNannyDeclarations
3927  PyObject *__pyx_t_1 = NULL;
3928  __Pyx_RefNannySetupContext("__set__", 0);
3929  __Pyx_TraceCall("__set__", __pyx_f[2], 11, 0, __PYX_ERR(2, 11, __pyx_L1_error));
3930  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(2, 11, __pyx_L1_error)
3931  __pyx_t_1 = __pyx_v_value;
3932  __Pyx_INCREF(__pyx_t_1);
3933  __Pyx_GIVEREF(__pyx_t_1);
3934  __Pyx_GOTREF(__pyx_v_self->BC_type);
3935  __Pyx_DECREF(__pyx_v_self->BC_type);
3936  __pyx_v_self->BC_type = ((PyObject*)__pyx_t_1);
3937  __pyx_t_1 = 0;
3938 
3939  /* function exit code */
3940  __pyx_r = 0;
3941  goto __pyx_L0;
3942  __pyx_L1_error:;
3943  __Pyx_XDECREF(__pyx_t_1);
3944  __Pyx_AddTraceback("BoundaryConditions.BC_Base.BC_type.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3945  __pyx_r = -1;
3946  __pyx_L0:;
3947  __Pyx_TraceReturn(Py_None, 0);
3948  __Pyx_RefNannyFinishContext();
3949  return __pyx_r;
3950 }
3951 
3952 /* Python wrapper */
3953 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(PyObject *__pyx_v_self); /*proto*/
3954 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(PyObject *__pyx_v_self) {
3955  int __pyx_r;
3956  __Pyx_RefNannyDeclarations
3957  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
3958  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3959 
3960  /* function exit code */
3961  __Pyx_RefNannyFinishContext();
3962  return __pyx_r;
3963 }
3964 
3965 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3966  int __pyx_r;
3967  __Pyx_TraceDeclarations
3968  __Pyx_RefNannyDeclarations
3969  __Pyx_RefNannySetupContext("__del__", 0);
3970  __Pyx_TraceCall("__del__", __pyx_f[2], 11, 0, __PYX_ERR(2, 11, __pyx_L1_error));
3971  __Pyx_INCREF(Py_None);
3972  __Pyx_GIVEREF(Py_None);
3973  __Pyx_GOTREF(__pyx_v_self->BC_type);
3974  __Pyx_DECREF(__pyx_v_self->BC_type);
3975  __pyx_v_self->BC_type = ((PyObject*)Py_None);
3976 
3977  /* function exit code */
3978  __pyx_r = 0;
3979  goto __pyx_L0;
3980  __pyx_L1_error:;
3981  __Pyx_AddTraceback("BoundaryConditions.BC_Base.BC_type.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3982  __pyx_r = -1;
3983  __pyx_L0:;
3984  __Pyx_TraceReturn(Py_None, 0);
3985  __Pyx_RefNannyFinishContext();
3986  return __pyx_r;
3987 }
3988 
3989 /* "BoundaryConditions.pxd":12
3990  * str name
3991  * str BC_type
3992  * object ct # <<<<<<<<<<<<<<
3993  * # cpdef void newGlobalBC(BC_Base cls, newstr name, object default_value)
3994  * # cpdef void getContext(BC_Base cls, object context=*)
3995  */
3996 
3997 /* Python wrapper */
3998 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(PyObject *__pyx_v_self); /*proto*/
3999 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(PyObject *__pyx_v_self) {
4000  PyObject *__pyx_r = 0;
4001  __Pyx_RefNannyDeclarations
4002  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
4003  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
4004 
4005  /* function exit code */
4006  __Pyx_RefNannyFinishContext();
4007  return __pyx_r;
4008 }
4009 
4010 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
4011  PyObject *__pyx_r = NULL;
4012  __Pyx_TraceDeclarations
4013  __Pyx_RefNannyDeclarations
4014  __Pyx_RefNannySetupContext("__get__", 0);
4015  __Pyx_TraceCall("__get__", __pyx_f[2], 12, 0, __PYX_ERR(2, 12, __pyx_L1_error));
4016  __Pyx_XDECREF(__pyx_r);
4017  __Pyx_INCREF(__pyx_v_self->ct);
4018  __pyx_r = __pyx_v_self->ct;
4019  goto __pyx_L0;
4020 
4021  /* function exit code */
4022  __pyx_L1_error:;
4023  __Pyx_AddTraceback("BoundaryConditions.BC_Base.ct.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4024  __pyx_r = NULL;
4025  __pyx_L0:;
4026  __Pyx_XGIVEREF(__pyx_r);
4027  __Pyx_TraceReturn(__pyx_r, 0);
4028  __Pyx_RefNannyFinishContext();
4029  return __pyx_r;
4030 }
4031 
4032 /* Python wrapper */
4033 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
4034 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4035  int __pyx_r;
4036  __Pyx_RefNannyDeclarations
4037  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
4038  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
4039 
4040  /* function exit code */
4041  __Pyx_RefNannyFinishContext();
4042  return __pyx_r;
4043 }
4044 
4045 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
4046  int __pyx_r;
4047  __Pyx_TraceDeclarations
4048  __Pyx_RefNannyDeclarations
4049  __Pyx_RefNannySetupContext("__set__", 0);
4050  __Pyx_TraceCall("__set__", __pyx_f[2], 12, 0, __PYX_ERR(2, 12, __pyx_L1_error));
4051  __Pyx_INCREF(__pyx_v_value);
4052  __Pyx_GIVEREF(__pyx_v_value);
4053  __Pyx_GOTREF(__pyx_v_self->ct);
4054  __Pyx_DECREF(__pyx_v_self->ct);
4055  __pyx_v_self->ct = __pyx_v_value;
4056 
4057  /* function exit code */
4058  __pyx_r = 0;
4059  goto __pyx_L0;
4060  __pyx_L1_error:;
4061  __Pyx_AddTraceback("BoundaryConditions.BC_Base.ct.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4062  __pyx_r = -1;
4063  __pyx_L0:;
4064  __Pyx_TraceReturn(Py_None, 0);
4065  __Pyx_RefNannyFinishContext();
4066  return __pyx_r;
4067 }
4068 
4069 /* Python wrapper */
4070 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(PyObject *__pyx_v_self); /*proto*/
4071 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(PyObject *__pyx_v_self) {
4072  int __pyx_r;
4073  __Pyx_RefNannyDeclarations
4074  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
4075  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
4076 
4077  /* function exit code */
4078  __Pyx_RefNannyFinishContext();
4079  return __pyx_r;
4080 }
4081 
4082 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
4083  int __pyx_r;
4084  __Pyx_TraceDeclarations
4085  __Pyx_RefNannyDeclarations
4086  __Pyx_RefNannySetupContext("__del__", 0);
4087  __Pyx_TraceCall("__del__", __pyx_f[2], 12, 0, __PYX_ERR(2, 12, __pyx_L1_error));
4088  __Pyx_INCREF(Py_None);
4089  __Pyx_GIVEREF(Py_None);
4090  __Pyx_GOTREF(__pyx_v_self->ct);
4091  __Pyx_DECREF(__pyx_v_self->ct);
4092  __pyx_v_self->ct = Py_None;
4093 
4094  /* function exit code */
4095  __pyx_r = 0;
4096  goto __pyx_L0;
4097  __pyx_L1_error:;
4098  __Pyx_AddTraceback("BoundaryConditions.BC_Base.ct.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4099  __pyx_r = -1;
4100  __pyx_L0:;
4101  __Pyx_TraceReturn(Py_None, 0);
4102  __Pyx_RefNannyFinishContext();
4103  return __pyx_r;
4104 }
4105 
4106 /* "(tree fragment)":1
4107  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
4108  * cdef tuple state
4109  * cdef object _dict
4110  */
4111 
4112 /* Python wrapper */
4113 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4114 static char __pyx_doc_18BoundaryConditions_7BC_Base_4__reduce_cython__[] = "BC_Base.__reduce_cython__(self)";
4115 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__, METH_NOARGS, __pyx_doc_18BoundaryConditions_7BC_Base_4__reduce_cython__};
4116 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4117  PyObject *__pyx_r = 0;
4118  __Pyx_RefNannyDeclarations
4119  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
4120  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
4121 
4122  /* function exit code */
4123  __Pyx_RefNannyFinishContext();
4124  return __pyx_r;
4125 }
4126 
4127 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
4128  PyObject *__pyx_v_state = 0;
4129  PyObject *__pyx_v__dict = 0;
4130  int __pyx_v_use_setstate;
4131  PyObject *__pyx_r = NULL;
4132  __Pyx_TraceDeclarations
4133  __Pyx_RefNannyDeclarations
4134  PyObject *__pyx_t_1 = NULL;
4135  PyObject *__pyx_t_2 = NULL;
4136  PyObject *__pyx_t_3 = NULL;
4137  int __pyx_t_4;
4138  int __pyx_t_5;
4139  int __pyx_t_6;
4140  __Pyx_TraceFrameInit(__pyx_codeobj__2)
4141  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
4142  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
4143 
4144  /* "(tree fragment)":5
4145  * cdef object _dict
4146  * cdef bint use_setstate
4147  * state = (self.BC_type, self.Shape, self._b_or, self.ct, self.name, self.nd) # <<<<<<<<<<<<<<
4148  * _dict = getattr(self, '__dict__', None)
4149  * if _dict is not None:
4150  */
4151  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_self->_b_or, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
4152  __Pyx_GOTREF(__pyx_t_1);
4153  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->nd); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
4154  __Pyx_GOTREF(__pyx_t_2);
4155  __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
4156  __Pyx_GOTREF(__pyx_t_3);
4157  __Pyx_INCREF(__pyx_v_self->BC_type);
4158  __Pyx_GIVEREF(__pyx_v_self->BC_type);
4159  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->BC_type);
4160  __Pyx_INCREF(__pyx_v_self->Shape);
4161  __Pyx_GIVEREF(__pyx_v_self->Shape);
4162  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->Shape);
4163  __Pyx_GIVEREF(__pyx_t_1);
4164  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
4165  __Pyx_INCREF(__pyx_v_self->ct);
4166  __Pyx_GIVEREF(__pyx_v_self->ct);
4167  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_self->ct);
4168  __Pyx_INCREF(__pyx_v_self->name);
4169  __Pyx_GIVEREF(__pyx_v_self->name);
4170  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_self->name);
4171  __Pyx_GIVEREF(__pyx_t_2);
4172  PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_2);
4173  __pyx_t_1 = 0;
4174  __pyx_t_2 = 0;
4175  __pyx_v_state = ((PyObject*)__pyx_t_3);
4176  __pyx_t_3 = 0;
4177 
4178  /* "(tree fragment)":6
4179  * cdef bint use_setstate
4180  * state = (self.BC_type, self.Shape, self._b_or, self.ct, self.name, self.nd)
4181  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
4182  * if _dict is not None:
4183  * state += (_dict,)
4184  */
4185  __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
4186  __Pyx_GOTREF(__pyx_t_3);
4187  __pyx_v__dict = __pyx_t_3;
4188  __pyx_t_3 = 0;
4189 
4190  /* "(tree fragment)":7
4191  * state = (self.BC_type, self.Shape, self._b_or, self.ct, self.name, self.nd)
4192  * _dict = getattr(self, '__dict__', None)
4193  * if _dict is not None: # <<<<<<<<<<<<<<
4194  * state += (_dict,)
4195  * use_setstate = True
4196  */
4197  __pyx_t_4 = (__pyx_v__dict != Py_None);
4198  __pyx_t_5 = (__pyx_t_4 != 0);
4199  if (__pyx_t_5) {
4200 
4201  /* "(tree fragment)":8
4202  * _dict = getattr(self, '__dict__', None)
4203  * if _dict is not None:
4204  * state += (_dict,) # <<<<<<<<<<<<<<
4205  * use_setstate = True
4206  * else:
4207  */
4208  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error)
4209  __Pyx_GOTREF(__pyx_t_3);
4210  __Pyx_INCREF(__pyx_v__dict);
4211  __Pyx_GIVEREF(__pyx_v__dict);
4212  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__dict);
4213  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error)
4214  __Pyx_GOTREF(__pyx_t_2);
4215  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4216  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_2));
4217  __pyx_t_2 = 0;
4218 
4219  /* "(tree fragment)":9
4220  * if _dict is not None:
4221  * state += (_dict,)
4222  * use_setstate = True # <<<<<<<<<<<<<<
4223  * else:
4224  * use_setstate = self.BC_type is not None or self.Shape is not None or self.ct is not None or self.name is not None
4225  */
4226  __pyx_v_use_setstate = 1;
4227 
4228  /* "(tree fragment)":7
4229  * state = (self.BC_type, self.Shape, self._b_or, self.ct, self.name, self.nd)
4230  * _dict = getattr(self, '__dict__', None)
4231  * if _dict is not None: # <<<<<<<<<<<<<<
4232  * state += (_dict,)
4233  * use_setstate = True
4234  */
4235  goto __pyx_L3;
4236  }
4237 
4238  /* "(tree fragment)":11
4239  * use_setstate = True
4240  * else:
4241  * use_setstate = self.BC_type is not None or self.Shape is not None or self.ct is not None or self.name is not None # <<<<<<<<<<<<<<
4242  * if use_setstate:
4243  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, None), state
4244  */
4245  /*else*/ {
4246  __pyx_t_4 = (__pyx_v_self->BC_type != ((PyObject*)Py_None));
4247  __pyx_t_6 = (__pyx_t_4 != 0);
4248  if (!__pyx_t_6) {
4249  } else {
4250  __pyx_t_5 = __pyx_t_6;
4251  goto __pyx_L4_bool_binop_done;
4252  }
4253  __pyx_t_6 = (__pyx_v_self->Shape != Py_None);
4254  __pyx_t_4 = (__pyx_t_6 != 0);
4255  if (!__pyx_t_4) {
4256  } else {
4257  __pyx_t_5 = __pyx_t_4;
4258  goto __pyx_L4_bool_binop_done;
4259  }
4260  __pyx_t_4 = (__pyx_v_self->ct != Py_None);
4261  __pyx_t_6 = (__pyx_t_4 != 0);
4262  if (!__pyx_t_6) {
4263  } else {
4264  __pyx_t_5 = __pyx_t_6;
4265  goto __pyx_L4_bool_binop_done;
4266  }
4267  __pyx_t_6 = (__pyx_v_self->name != ((PyObject*)Py_None));
4268  __pyx_t_4 = (__pyx_t_6 != 0);
4269  __pyx_t_5 = __pyx_t_4;
4270  __pyx_L4_bool_binop_done:;
4271  __pyx_v_use_setstate = __pyx_t_5;
4272  }
4273  __pyx_L3:;
4274 
4275  /* "(tree fragment)":12
4276  * else:
4277  * use_setstate = self.BC_type is not None or self.Shape is not None or self.ct is not None or self.name is not None
4278  * if use_setstate: # <<<<<<<<<<<<<<
4279  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, None), state
4280  * else:
4281  */
4282  __pyx_t_5 = (__pyx_v_use_setstate != 0);
4283  if (__pyx_t_5) {
4284 
4285  /* "(tree fragment)":13
4286  * use_setstate = self.BC_type is not None or self.Shape is not None or self.ct is not None or self.name is not None
4287  * if use_setstate:
4288  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, None), state # <<<<<<<<<<<<<<
4289  * else:
4290  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
4291  */
4292  __Pyx_XDECREF(__pyx_r);
4293  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pyx_unpickle_BC_Base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error)
4294  __Pyx_GOTREF(__pyx_t_2);
4295  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
4296  __Pyx_GOTREF(__pyx_t_3);
4297  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4298  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4299  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4300  __Pyx_INCREF(__pyx_int_158231071);
4301  __Pyx_GIVEREF(__pyx_int_158231071);
4302  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_158231071);
4303  __Pyx_INCREF(Py_None);
4304  __Pyx_GIVEREF(Py_None);
4305  PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None);
4306  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
4307  __Pyx_GOTREF(__pyx_t_1);
4308  __Pyx_GIVEREF(__pyx_t_2);
4309  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
4310  __Pyx_GIVEREF(__pyx_t_3);
4311  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
4312  __Pyx_INCREF(__pyx_v_state);
4313  __Pyx_GIVEREF(__pyx_v_state);
4314  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
4315  __pyx_t_2 = 0;
4316  __pyx_t_3 = 0;
4317  __pyx_r = __pyx_t_1;
4318  __pyx_t_1 = 0;
4319  goto __pyx_L0;
4320 
4321  /* "(tree fragment)":12
4322  * else:
4323  * use_setstate = self.BC_type is not None or self.Shape is not None or self.ct is not None or self.name is not None
4324  * if use_setstate: # <<<<<<<<<<<<<<
4325  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, None), state
4326  * else:
4327  */
4328  }
4329 
4330  /* "(tree fragment)":15
4331  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, None), state
4332  * else:
4333  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state) # <<<<<<<<<<<<<<
4334  * def __setstate_cython__(self, __pyx_state):
4335  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state)
4336  */
4337  /*else*/ {
4338  __Pyx_XDECREF(__pyx_r);
4339  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_BC_Base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
4340  __Pyx_GOTREF(__pyx_t_1);
4341  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
4342  __Pyx_GOTREF(__pyx_t_3);
4343  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4344  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4345  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4346  __Pyx_INCREF(__pyx_int_158231071);
4347  __Pyx_GIVEREF(__pyx_int_158231071);
4348  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_158231071);
4349  __Pyx_INCREF(__pyx_v_state);
4350  __Pyx_GIVEREF(__pyx_v_state);
4351  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state);
4352  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error)
4353  __Pyx_GOTREF(__pyx_t_2);
4354  __Pyx_GIVEREF(__pyx_t_1);
4355  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
4356  __Pyx_GIVEREF(__pyx_t_3);
4357  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
4358  __pyx_t_1 = 0;
4359  __pyx_t_3 = 0;
4360  __pyx_r = __pyx_t_2;
4361  __pyx_t_2 = 0;
4362  goto __pyx_L0;
4363  }
4364 
4365  /* "(tree fragment)":1
4366  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
4367  * cdef tuple state
4368  * cdef object _dict
4369  */
4370 
4371  /* function exit code */
4372  __pyx_L1_error:;
4373  __Pyx_XDECREF(__pyx_t_1);
4374  __Pyx_XDECREF(__pyx_t_2);
4375  __Pyx_XDECREF(__pyx_t_3);
4376  __Pyx_AddTraceback("BoundaryConditions.BC_Base.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4377  __pyx_r = NULL;
4378  __pyx_L0:;
4379  __Pyx_XDECREF(__pyx_v_state);
4380  __Pyx_XDECREF(__pyx_v__dict);
4381  __Pyx_XGIVEREF(__pyx_r);
4382  __Pyx_TraceReturn(__pyx_r, 0);
4383  __Pyx_RefNannyFinishContext();
4384  return __pyx_r;
4385 }
4386 
4387 /* "(tree fragment)":16
4388  * else:
4389  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
4390  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
4391  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state)
4392  */
4393 
4394 /* Python wrapper */
4395 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
4396 static char __pyx_doc_18BoundaryConditions_7BC_Base_6__setstate_cython__[] = "BC_Base.__setstate_cython__(self, __pyx_state)";
4397 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__, METH_O, __pyx_doc_18BoundaryConditions_7BC_Base_6__setstate_cython__};
4398 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4399  PyObject *__pyx_r = 0;
4400  __Pyx_RefNannyDeclarations
4401  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
4402  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
4403 
4404  /* function exit code */
4405  __Pyx_RefNannyFinishContext();
4406  return __pyx_r;
4407 }
4408 
4409 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4410  PyObject *__pyx_r = NULL;
4411  __Pyx_TraceDeclarations
4412  __Pyx_RefNannyDeclarations
4413  PyObject *__pyx_t_1 = NULL;
4414  __Pyx_TraceFrameInit(__pyx_codeobj__3)
4415  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
4416  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error));
4417 
4418  /* "(tree fragment)":17
4419  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
4420  * def __setstate_cython__(self, __pyx_state):
4421  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
4422  */
4423  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
4424  __pyx_t_1 = __pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
4425  __Pyx_GOTREF(__pyx_t_1);
4426  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4427 
4428  /* "(tree fragment)":16
4429  * else:
4430  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
4431  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
4432  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state)
4433  */
4434 
4435  /* function exit code */
4436  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4437  goto __pyx_L0;
4438  __pyx_L1_error:;
4439  __Pyx_XDECREF(__pyx_t_1);
4440  __Pyx_AddTraceback("BoundaryConditions.BC_Base.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4441  __pyx_r = NULL;
4442  __pyx_L0:;
4443  __Pyx_XGIVEREF(__pyx_r);
4444  __Pyx_TraceReturn(__pyx_r, 0);
4445  __Pyx_RefNannyFinishContext();
4446  return __pyx_r;
4447 }
4448 
4449 /* "BoundaryConditions.py":78
4450  * no boundary condition
4451  * """
4452  * def __init__(self): # <<<<<<<<<<<<<<
4453  * self.uOfXT = None
4454  *
4455  */
4456 
4457 /* Python wrapper */
4458 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4459 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4460  int __pyx_r;
4461  __Pyx_RefNannyDeclarations
4462  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
4463  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
4464  __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
4465  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
4466  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4467 
4468  /* function exit code */
4469  __Pyx_RefNannyFinishContext();
4470  return __pyx_r;
4471 }
4472 
4473 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4474  int __pyx_r;
4475  __Pyx_TraceDeclarations
4476  __Pyx_RefNannyDeclarations
4477  __Pyx_RefNannySetupContext("__init__", 0);
4478  __Pyx_TraceCall("__init__", __pyx_f[0], 78, 0, __PYX_ERR(0, 78, __pyx_L1_error));
4479 
4480  /* "BoundaryConditions.py":79
4481  * """
4482  * def __init__(self):
4483  * self.uOfXT = None # <<<<<<<<<<<<<<
4484  *
4485  * def init_cython(self):
4486  */
4487  __Pyx_INCREF(Py_None);
4488  __Pyx_GIVEREF(Py_None);
4489  __Pyx_GOTREF(__pyx_v_self->uOfXT);
4490  __Pyx_DECREF(__pyx_v_self->uOfXT);
4491  __pyx_v_self->uOfXT = Py_None;
4492 
4493  /* "BoundaryConditions.py":78
4494  * no boundary condition
4495  * """
4496  * def __init__(self): # <<<<<<<<<<<<<<
4497  * self.uOfXT = None
4498  *
4499  */
4500 
4501  /* function exit code */
4502  __pyx_r = 0;
4503  goto __pyx_L0;
4504  __pyx_L1_error:;
4505  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4506  __pyx_r = -1;
4507  __pyx_L0:;
4508  __Pyx_TraceReturn(Py_None, 0);
4509  __Pyx_RefNannyFinishContext();
4510  return __pyx_r;
4511 }
4512 
4513 /* "BoundaryConditions.py":81
4514  * self.uOfXT = None
4515  *
4516  * def init_cython(self): # <<<<<<<<<<<<<<
4517  * return self.uOfXT
4518  *
4519  */
4520 
4521 /* Python wrapper */
4522 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4523 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_2init_cython[] = "BoundaryCondition.init_cython(self)";
4524 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_3init_cython = {"init_cython", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_2init_cython};
4525 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4526  PyObject *__pyx_r = 0;
4527  __Pyx_RefNannyDeclarations
4528  __Pyx_RefNannySetupContext("init_cython (wrapper)", 0);
4529  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4530 
4531  /* function exit code */
4532  __Pyx_RefNannyFinishContext();
4533  return __pyx_r;
4534 }
4535 
4536 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4537  PyObject *__pyx_r = NULL;
4538  __Pyx_TraceDeclarations
4539  __Pyx_RefNannyDeclarations
4540  __Pyx_TraceFrameInit(__pyx_codeobj__4)
4541  __Pyx_RefNannySetupContext("init_cython", 0);
4542  __Pyx_TraceCall("init_cython", __pyx_f[0], 81, 0, __PYX_ERR(0, 81, __pyx_L1_error));
4543 
4544  /* "BoundaryConditions.py":82
4545  *
4546  * def init_cython(self):
4547  * return self.uOfXT # <<<<<<<<<<<<<<
4548  *
4549  * def resetBC(self):
4550  */
4551  __Pyx_XDECREF(__pyx_r);
4552  __Pyx_INCREF(__pyx_v_self->uOfXT);
4553  __pyx_r = __pyx_v_self->uOfXT;
4554  goto __pyx_L0;
4555 
4556  /* "BoundaryConditions.py":81
4557  * self.uOfXT = None
4558  *
4559  * def init_cython(self): # <<<<<<<<<<<<<<
4560  * return self.uOfXT
4561  *
4562  */
4563 
4564  /* function exit code */
4565  __pyx_L1_error:;
4566  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.init_cython", __pyx_clineno, __pyx_lineno, __pyx_filename);
4567  __pyx_r = NULL;
4568  __pyx_L0:;
4569  __Pyx_XGIVEREF(__pyx_r);
4570  __Pyx_TraceReturn(__pyx_r, 0);
4571  __Pyx_RefNannyFinishContext();
4572  return __pyx_r;
4573 }
4574 
4575 /* "BoundaryConditions.py":84
4576  * return self.uOfXT
4577  *
4578  * def resetBC(self): # <<<<<<<<<<<<<<
4579  * self.uOfXT = None
4580  *
4581  */
4582 
4583 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4584 static void __pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, int __pyx_skip_dispatch) {
4585  __Pyx_TraceDeclarations
4586  __Pyx_RefNannyDeclarations
4587  PyObject *__pyx_t_1 = NULL;
4588  PyObject *__pyx_t_2 = NULL;
4589  PyObject *__pyx_t_3 = NULL;
4590  PyObject *__pyx_t_4 = NULL;
4591  __Pyx_TraceFrameInit(__pyx_codeobj__5)
4592  __Pyx_RefNannySetupContext("resetBC", 0);
4593  __Pyx_TraceCall("resetBC", __pyx_f[0], 84, 0, __PYX_ERR(0, 84, __pyx_L1_error));
4594  /* Check if called by wrapper */
4595  if (unlikely(__pyx_skip_dispatch)) ;
4596  /* Check if overridden in Python */
4597  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
4598  #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
4599  static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
4600  if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
4601  else {
4602  PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
4603  #endif
4604  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_resetBC); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
4605  __Pyx_GOTREF(__pyx_t_1);
4606  if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC)) {
4607  __Pyx_INCREF(__pyx_t_1);
4608  __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
4609  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4610  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
4611  if (likely(__pyx_t_4)) {
4612  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4613  __Pyx_INCREF(__pyx_t_4);
4614  __Pyx_INCREF(function);
4615  __Pyx_DECREF_SET(__pyx_t_3, function);
4616  }
4617  }
4618  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
4619  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4620  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
4621  __Pyx_GOTREF(__pyx_t_2);
4622  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4623  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4624  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4625  goto __pyx_L0;
4626  }
4627  #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
4628  tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
4629  obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
4630  if (unlikely(type_dict_guard != tp_dict_version)) {
4631  tp_dict_version = obj_dict_version = 0;
4632  }
4633  #endif
4634  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4635  #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
4636  }
4637  #endif
4638  }
4639 
4640  /* "BoundaryConditions.py":85
4641  *
4642  * def resetBC(self):
4643  * self.uOfXT = None # <<<<<<<<<<<<<<
4644  *
4645  * def setConstantBC(self, value):
4646  */
4647  __Pyx_INCREF(Py_None);
4648  __Pyx_GIVEREF(Py_None);
4649  __Pyx_GOTREF(__pyx_v_self->uOfXT);
4650  __Pyx_DECREF(__pyx_v_self->uOfXT);
4651  __pyx_v_self->uOfXT = Py_None;
4652 
4653  /* "BoundaryConditions.py":84
4654  * return self.uOfXT
4655  *
4656  * def resetBC(self): # <<<<<<<<<<<<<<
4657  * self.uOfXT = None
4658  *
4659  */
4660 
4661  /* function exit code */
4662  goto __pyx_L0;
4663  __pyx_L1_error:;
4664  __Pyx_XDECREF(__pyx_t_1);
4665  __Pyx_XDECREF(__pyx_t_2);
4666  __Pyx_XDECREF(__pyx_t_3);
4667  __Pyx_XDECREF(__pyx_t_4);
4668  __Pyx_WriteUnraisable("BoundaryConditions.BoundaryCondition.resetBC", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4669  __pyx_L0:;
4670  __Pyx_TraceReturn(Py_None, 0);
4671  __Pyx_RefNannyFinishContext();
4672 }
4673 
4674 /* Python wrapper */
4675 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4676 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_4resetBC[] = "BoundaryCondition.resetBC(self) -> void";
4677 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_5resetBC = {"resetBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_4resetBC};
4678 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4679  PyObject *__pyx_r = 0;
4680  __Pyx_RefNannyDeclarations
4681  __Pyx_RefNannySetupContext("resetBC (wrapper)", 0);
4682  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4683 
4684  /* function exit code */
4685  __Pyx_RefNannyFinishContext();
4686  return __pyx_r;
4687 }
4688 
4689 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4690  PyObject *__pyx_r = NULL;
4691  __Pyx_TraceDeclarations
4692  __Pyx_RefNannyDeclarations
4693  PyObject *__pyx_t_1 = NULL;
4694  __Pyx_TraceFrameInit(__pyx_codeobj__5)
4695  __Pyx_RefNannySetupContext("resetBC", 0);
4696  __Pyx_TraceCall("resetBC (wrapper)", __pyx_f[0], 84, 0, __PYX_ERR(0, 84, __pyx_L1_error));
4697  __Pyx_XDECREF(__pyx_r);
4698  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
4699  __Pyx_GOTREF(__pyx_t_1);
4700  __pyx_r = __pyx_t_1;
4701  __pyx_t_1 = 0;
4702  goto __pyx_L0;
4703 
4704  /* function exit code */
4705  __pyx_L1_error:;
4706  __Pyx_XDECREF(__pyx_t_1);
4707  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.resetBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
4708  __pyx_r = NULL;
4709  __pyx_L0:;
4710  __Pyx_XGIVEREF(__pyx_r);
4711  __Pyx_TraceReturn(__pyx_r, 0);
4712  __Pyx_RefNannyFinishContext();
4713  return __pyx_r;
4714 }
4715 
4716 /* "BoundaryConditions.py":87
4717  * self.uOfXT = None
4718  *
4719  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
4720  * """
4721  * function returning constant BC
4722  */
4723 
4724 /* Python wrapper */
4725 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
4726 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC[] = "BoundaryCondition.setConstantBC(self, value)\n\n function returning constant BC\n\n Parameters\n ----------\n value : float\n Constant value\n\n ";
4727 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_7setConstantBC = {"setConstantBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC};
4728 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4729  PyObject *__pyx_r = 0;
4730  __Pyx_RefNannyDeclarations
4731  __Pyx_RefNannySetupContext("setConstantBC (wrapper)", 0);
4732  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v_value));
4733 
4734  /* function exit code */
4735  __Pyx_RefNannyFinishContext();
4736  return __pyx_r;
4737 }
4738 
4739 /* "BoundaryConditions.py":97
4740  *
4741  * """
4742  * self.uOfXT = lambda x, t, n=np.zeros(3,): value # <<<<<<<<<<<<<<
4743  *
4744  *
4745  */
4746 
4747 static PyObject *__pyx_pf_18BoundaryConditions_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
4748  PyObject *__pyx_r = NULL;
4749  __Pyx_TraceDeclarations
4750  __Pyx_RefNannyDeclarations
4751  PyObject *__pyx_t_1 = NULL;
4752  PyObject *__pyx_t_2 = NULL;
4753  __Pyx_RefNannySetupContext("__defaults__", 0);
4754  __Pyx_TraceCall("__defaults__", __pyx_f[0], 97, 0, __PYX_ERR(0, 97, __pyx_L1_error));
4755  __Pyx_XDECREF(__pyx_r);
4756  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
4757  __Pyx_GOTREF(__pyx_t_1);
4758  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_n);
4759  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_n);
4760  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_n);
4761  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
4762  __Pyx_GOTREF(__pyx_t_2);
4763  __Pyx_GIVEREF(__pyx_t_1);
4764  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
4765  __Pyx_INCREF(Py_None);
4766  __Pyx_GIVEREF(Py_None);
4767  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
4768  __pyx_t_1 = 0;
4769  __pyx_r = __pyx_t_2;
4770  __pyx_t_2 = 0;
4771  goto __pyx_L0;
4772 
4773  /* function exit code */
4774  __pyx_L1_error:;
4775  __Pyx_XDECREF(__pyx_t_1);
4776  __Pyx_XDECREF(__pyx_t_2);
4777  __Pyx_AddTraceback("BoundaryConditions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4778  __pyx_r = NULL;
4779  __pyx_L0:;
4780  __Pyx_XGIVEREF(__pyx_r);
4781  __Pyx_TraceReturn(__pyx_r, 0);
4782  __Pyx_RefNannyFinishContext();
4783  return __pyx_r;
4784 }
4785 
4786 /* Python wrapper */
4787 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4788 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda = {"lambda", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda, METH_VARARGS|METH_KEYWORDS, 0};
4789 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4790  CYTHON_UNUSED PyObject *__pyx_v_x = 0;
4791  CYTHON_UNUSED PyObject *__pyx_v_t = 0;
4792  CYTHON_UNUSED PyObject *__pyx_v_n = 0;
4793  PyObject *__pyx_r = 0;
4794  __Pyx_RefNannyDeclarations
4795  __Pyx_RefNannySetupContext("lambda (wrapper)", 0);
4796  {
4797  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,&__pyx_n_s_n,0};
4798  PyObject* values[3] = {0,0,0};
4799  __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self);
4800  values[2] = __pyx_dynamic_args->__pyx_arg_n;
4801  if (unlikely(__pyx_kwds)) {
4802  Py_ssize_t kw_args;
4803  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4804  switch (pos_args) {
4805  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4806  CYTHON_FALLTHROUGH;
4807  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4808  CYTHON_FALLTHROUGH;
4809  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4810  CYTHON_FALLTHROUGH;
4811  case 0: break;
4812  default: goto __pyx_L5_argtuple_error;
4813  }
4814  kw_args = PyDict_Size(__pyx_kwds);
4815  switch (pos_args) {
4816  case 0:
4817  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
4818  else goto __pyx_L5_argtuple_error;
4819  CYTHON_FALLTHROUGH;
4820  case 1:
4821  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
4822  else {
4823  __Pyx_RaiseArgtupleInvalid("lambda", 0, 2, 3, 1); __PYX_ERR(0, 97, __pyx_L3_error)
4824  }
4825  CYTHON_FALLTHROUGH;
4826  case 2:
4827  if (kw_args > 0) {
4828  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);
4829  if (value) { values[2] = value; kw_args--; }
4830  }
4831  }
4832  if (unlikely(kw_args > 0)) {
4833  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda") < 0)) __PYX_ERR(0, 97, __pyx_L3_error)
4834  }
4835  } else {
4836  switch (PyTuple_GET_SIZE(__pyx_args)) {
4837  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4838  CYTHON_FALLTHROUGH;
4839  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4840  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4841  break;
4842  default: goto __pyx_L5_argtuple_error;
4843  }
4844  }
4845  __pyx_v_x = values[0];
4846  __pyx_v_t = values[1];
4847  __pyx_v_n = values[2];
4848  }
4849  goto __pyx_L4_argument_unpacking_done;
4850  __pyx_L5_argtuple_error:;
4851  __Pyx_RaiseArgtupleInvalid("lambda", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 97, __pyx_L3_error)
4852  __pyx_L3_error:;
4853  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setConstantBC.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
4854  __Pyx_RefNannyFinishContext();
4855  return NULL;
4856  __pyx_L4_argument_unpacking_done:;
4857  __pyx_r = __pyx_lambda_funcdef_lambda(__pyx_self, __pyx_v_x, __pyx_v_t, __pyx_v_n);
4858 
4859  /* function exit code */
4860  __Pyx_RefNannyFinishContext();
4861  return __pyx_r;
4862 }
4863 
4864 static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n) {
4865  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_cur_scope;
4866  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_outer_scope;
4867  PyObject *__pyx_r = NULL;
4868  __Pyx_TraceDeclarations
4869  __Pyx_RefNannyDeclarations
4870  __Pyx_RefNannySetupContext("lambda", 0);
4871  __pyx_outer_scope = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *) __Pyx_CyFunction_GetClosure(__pyx_self);
4872  __pyx_cur_scope = __pyx_outer_scope;
4873  __Pyx_TraceCall("lambda", __pyx_f[0], 97, 0, __PYX_ERR(0, 97, __pyx_L1_error));
4874  __Pyx_XDECREF(__pyx_r);
4875  if (unlikely(!__pyx_cur_scope->__pyx_v_value)) { __Pyx_RaiseClosureNameError("value"); __PYX_ERR(0, 97, __pyx_L1_error) }
4876  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
4877  __pyx_r = __pyx_cur_scope->__pyx_v_value;
4878  goto __pyx_L0;
4879 
4880  /* function exit code */
4881  __pyx_L1_error:;
4882  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setConstantBC.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
4883  __pyx_r = NULL;
4884  __pyx_L0:;
4885  __Pyx_XGIVEREF(__pyx_r);
4886  __Pyx_TraceReturn(__pyx_r, 0);
4887  __Pyx_RefNannyFinishContext();
4888  return __pyx_r;
4889 }
4890 
4891 /* "BoundaryConditions.py":87
4892  * self.uOfXT = None
4893  *
4894  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
4895  * """
4896  * function returning constant BC
4897  */
4898 
4899 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value) {
4900  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_cur_scope;
4901  PyObject *__pyx_r = NULL;
4902  __Pyx_TraceDeclarations
4903  __Pyx_RefNannyDeclarations
4904  PyObject *__pyx_t_1 = NULL;
4905  PyObject *__pyx_t_2 = NULL;
4906  PyObject *__pyx_t_3 = NULL;
4907  PyObject *__pyx_t_4 = NULL;
4908  __Pyx_TraceFrameInit(__pyx_codeobj__6)
4909  __Pyx_RefNannySetupContext("setConstantBC", 0);
4910  __pyx_cur_scope = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(__pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC, __pyx_empty_tuple, NULL);
4911  if (unlikely(!__pyx_cur_scope)) {
4912  __pyx_cur_scope = ((struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)Py_None);
4913  __Pyx_INCREF(Py_None);
4914  __PYX_ERR(0, 87, __pyx_L1_error)
4915  } else {
4916  __Pyx_GOTREF(__pyx_cur_scope);
4917  }
4918  __Pyx_TraceCall("setConstantBC", __pyx_f[0], 87, 0, __PYX_ERR(0, 87, __pyx_L1_error));
4919  __pyx_cur_scope->__pyx_v_value = __pyx_v_value;
4920  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
4921  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value);
4922 
4923  /* "BoundaryConditions.py":97
4924  *
4925  * """
4926  * self.uOfXT = lambda x, t, n=np.zeros(3,): value # <<<<<<<<<<<<<<
4927  *
4928  *
4929  */
4930  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda, 0, __pyx_n_s_setConstantBC_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_BoundaryConditions, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
4931  __Pyx_GOTREF(__pyx_t_1);
4932  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 97, __pyx_L1_error)
4933  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error)
4934  __Pyx_GOTREF(__pyx_t_3);
4935  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
4936  __Pyx_GOTREF(__pyx_t_4);
4937  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4938  __pyx_t_3 = NULL;
4939  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
4940  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
4941  if (likely(__pyx_t_3)) {
4942  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
4943  __Pyx_INCREF(__pyx_t_3);
4944  __Pyx_INCREF(function);
4945  __Pyx_DECREF_SET(__pyx_t_4, function);
4946  }
4947  }
4948  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_3);
4949  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4950  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
4951  __Pyx_GOTREF(__pyx_t_2);
4952  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4953  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_1)->__pyx_arg_n = __pyx_t_2;
4954  __Pyx_GIVEREF(__pyx_t_2);
4955  __pyx_t_2 = 0;
4956  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_18BoundaryConditions_2__defaults__);
4957  __Pyx_GIVEREF(__pyx_t_1);
4958  __Pyx_GOTREF(__pyx_v_self->uOfXT);
4959  __Pyx_DECREF(__pyx_v_self->uOfXT);
4960  __pyx_v_self->uOfXT = __pyx_t_1;
4961  __pyx_t_1 = 0;
4962 
4963  /* "BoundaryConditions.py":87
4964  * self.uOfXT = None
4965  *
4966  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
4967  * """
4968  * function returning constant BC
4969  */
4970 
4971  /* function exit code */
4972  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4973  goto __pyx_L0;
4974  __pyx_L1_error:;
4975  __Pyx_XDECREF(__pyx_t_1);
4976  __Pyx_XDECREF(__pyx_t_2);
4977  __Pyx_XDECREF(__pyx_t_3);
4978  __Pyx_XDECREF(__pyx_t_4);
4979  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setConstantBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
4980  __pyx_r = NULL;
4981  __pyx_L0:;
4982  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
4983  __Pyx_XGIVEREF(__pyx_r);
4984  __Pyx_TraceReturn(__pyx_r, 0);
4985  __Pyx_RefNannyFinishContext();
4986  return __pyx_r;
4987 }
4988 
4989 /* "BoundaryConditions.py":100
4990  *
4991  *
4992  * def setLinearBC(self, a0, a): # <<<<<<<<<<<<<<
4993  * """
4994  * function returning value=a0+ax*x+ay*y+az*z
4995  */
4996 
4997 /* Python wrapper */
4998 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4999 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_8setLinearBC[] = "BoundaryCondition.setLinearBC(self, a0, a)\n\n function returning value=a0+ax*x+ay*y+az*z\n\n Parameters\n ----------\n a0 : float\n constant\n a: numpy.ndarray\n ax,ay,az\n\n ";
5000 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_9setLinearBC = {"setLinearBC", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_8setLinearBC};
5001 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5002  PyObject *__pyx_v_a0 = 0;
5003  PyObject *__pyx_v_a = 0;
5004  PyObject *__pyx_r = 0;
5005  __Pyx_RefNannyDeclarations
5006  __Pyx_RefNannySetupContext("setLinearBC (wrapper)", 0);
5007  {
5008  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a0,&__pyx_n_s_a,0};
5009  PyObject* values[2] = {0,0};
5010  if (unlikely(__pyx_kwds)) {
5011  Py_ssize_t kw_args;
5012  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5013  switch (pos_args) {
5014  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5015  CYTHON_FALLTHROUGH;
5016  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5017  CYTHON_FALLTHROUGH;
5018  case 0: break;
5019  default: goto __pyx_L5_argtuple_error;
5020  }
5021  kw_args = PyDict_Size(__pyx_kwds);
5022  switch (pos_args) {
5023  case 0:
5024  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a0)) != 0)) kw_args--;
5025  else goto __pyx_L5_argtuple_error;
5026  CYTHON_FALLTHROUGH;
5027  case 1:
5028  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
5029  else {
5030  __Pyx_RaiseArgtupleInvalid("setLinearBC", 1, 2, 2, 1); __PYX_ERR(0, 100, __pyx_L3_error)
5031  }
5032  }
5033  if (unlikely(kw_args > 0)) {
5034  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setLinearBC") < 0)) __PYX_ERR(0, 100, __pyx_L3_error)
5035  }
5036  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5037  goto __pyx_L5_argtuple_error;
5038  } else {
5039  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5040  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5041  }
5042  __pyx_v_a0 = values[0];
5043  __pyx_v_a = values[1];
5044  }
5045  goto __pyx_L4_argument_unpacking_done;
5046  __pyx_L5_argtuple_error:;
5047  __Pyx_RaiseArgtupleInvalid("setLinearBC", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 100, __pyx_L3_error)
5048  __pyx_L3_error:;
5049  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
5050  __Pyx_RefNannyFinishContext();
5051  return NULL;
5052  __pyx_L4_argument_unpacking_done:;
5053  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), __pyx_v_a0, __pyx_v_a);
5054 
5055  /* function exit code */
5056  __Pyx_RefNannyFinishContext();
5057  return __pyx_r;
5058 }
5059 
5060 /* "BoundaryConditions.py":113
5061  * """
5062  *
5063  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:]) # <<<<<<<<<<<<<<
5064  *
5065  * def setLinearRamp(self,t1,value):
5066  */
5067 
5068 static PyObject *__pyx_pf_18BoundaryConditions_4__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
5069  PyObject *__pyx_r = NULL;
5070  __Pyx_TraceDeclarations
5071  __Pyx_RefNannyDeclarations
5072  PyObject *__pyx_t_1 = NULL;
5073  PyObject *__pyx_t_2 = NULL;
5074  __Pyx_RefNannySetupContext("__defaults__", 0);
5075  __Pyx_TraceCall("__defaults__", __pyx_f[0], 113, 0, __PYX_ERR(0, 113, __pyx_L1_error));
5076  __Pyx_XDECREF(__pyx_r);
5077  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
5078  __Pyx_GOTREF(__pyx_t_1);
5079  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_n);
5080  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_n);
5081  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_n);
5082  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
5083  __Pyx_GOTREF(__pyx_t_2);
5084  __Pyx_GIVEREF(__pyx_t_1);
5085  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
5086  __Pyx_INCREF(Py_None);
5087  __Pyx_GIVEREF(Py_None);
5088  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
5089  __pyx_t_1 = 0;
5090  __pyx_r = __pyx_t_2;
5091  __pyx_t_2 = 0;
5092  goto __pyx_L0;
5093 
5094  /* function exit code */
5095  __pyx_L1_error:;
5096  __Pyx_XDECREF(__pyx_t_1);
5097  __Pyx_XDECREF(__pyx_t_2);
5098  __Pyx_AddTraceback("BoundaryConditions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5099  __pyx_r = NULL;
5100  __pyx_L0:;
5101  __Pyx_XGIVEREF(__pyx_r);
5102  __Pyx_TraceReturn(__pyx_r, 0);
5103  __Pyx_RefNannyFinishContext();
5104  return __pyx_r;
5105 }
5106 
5107 /* Python wrapper */
5108 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5109 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1 = {"lambda1", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1, METH_VARARGS|METH_KEYWORDS, 0};
5110 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5111  PyObject *__pyx_v_x = 0;
5112  CYTHON_UNUSED PyObject *__pyx_v_t = 0;
5113  CYTHON_UNUSED PyObject *__pyx_v_n = 0;
5114  PyObject *__pyx_r = 0;
5115  __Pyx_RefNannyDeclarations
5116  __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0);
5117  {
5118  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,&__pyx_n_s_n,0};
5119  PyObject* values[3] = {0,0,0};
5120  __pyx_defaults1 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self);
5121  values[2] = __pyx_dynamic_args->__pyx_arg_n;
5122  if (unlikely(__pyx_kwds)) {
5123  Py_ssize_t kw_args;
5124  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5125  switch (pos_args) {
5126  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5127  CYTHON_FALLTHROUGH;
5128  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5129  CYTHON_FALLTHROUGH;
5130  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5131  CYTHON_FALLTHROUGH;
5132  case 0: break;
5133  default: goto __pyx_L5_argtuple_error;
5134  }
5135  kw_args = PyDict_Size(__pyx_kwds);
5136  switch (pos_args) {
5137  case 0:
5138  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5139  else goto __pyx_L5_argtuple_error;
5140  CYTHON_FALLTHROUGH;
5141  case 1:
5142  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5143  else {
5144  __Pyx_RaiseArgtupleInvalid("lambda1", 0, 2, 3, 1); __PYX_ERR(0, 113, __pyx_L3_error)
5145  }
5146  CYTHON_FALLTHROUGH;
5147  case 2:
5148  if (kw_args > 0) {
5149  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);
5150  if (value) { values[2] = value; kw_args--; }
5151  }
5152  }
5153  if (unlikely(kw_args > 0)) {
5154  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda1") < 0)) __PYX_ERR(0, 113, __pyx_L3_error)
5155  }
5156  } else {
5157  switch (PyTuple_GET_SIZE(__pyx_args)) {
5158  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5159  CYTHON_FALLTHROUGH;
5160  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5161  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5162  break;
5163  default: goto __pyx_L5_argtuple_error;
5164  }
5165  }
5166  __pyx_v_x = values[0];
5167  __pyx_v_t = values[1];
5168  __pyx_v_n = values[2];
5169  }
5170  goto __pyx_L4_argument_unpacking_done;
5171  __pyx_L5_argtuple_error:;
5172  __Pyx_RaiseArgtupleInvalid("lambda1", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 113, __pyx_L3_error)
5173  __pyx_L3_error:;
5174  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearBC.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
5175  __Pyx_RefNannyFinishContext();
5176  return NULL;
5177  __pyx_L4_argument_unpacking_done:;
5178  __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self, __pyx_v_x, __pyx_v_t, __pyx_v_n);
5179 
5180  /* function exit code */
5181  __Pyx_RefNannyFinishContext();
5182  return __pyx_r;
5183 }
5184 
5185 static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n) {
5186  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_cur_scope;
5187  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_outer_scope;
5188  PyObject *__pyx_r = NULL;
5189  __Pyx_TraceDeclarations
5190  __Pyx_RefNannyDeclarations
5191  PyObject *__pyx_t_1 = NULL;
5192  PyObject *__pyx_t_2 = NULL;
5193  PyObject *__pyx_t_3 = NULL;
5194  __Pyx_RefNannySetupContext("lambda1", 0);
5195  __pyx_outer_scope = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *) __Pyx_CyFunction_GetClosure(__pyx_self);
5196  __pyx_cur_scope = __pyx_outer_scope;
5197  __Pyx_TraceCall("lambda1", __pyx_f[0], 113, 0, __PYX_ERR(0, 113, __pyx_L1_error));
5198  __Pyx_XDECREF(__pyx_r);
5199  if (unlikely(!__pyx_cur_scope->__pyx_v_a0)) { __Pyx_RaiseClosureNameError("a0"); __PYX_ERR(0, 113, __pyx_L1_error) }
5200  if (unlikely(!__pyx_cur_scope->__pyx_v_a)) { __Pyx_RaiseClosureNameError("a"); __PYX_ERR(0, 113, __pyx_L1_error) }
5201  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_a, 0, 0, NULL, NULL, &__pyx_slice__7, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
5202  __Pyx_GOTREF(__pyx_t_1);
5203  __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_x, 0, 0, NULL, NULL, &__pyx_slice__7, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
5204  __Pyx_GOTREF(__pyx_t_2);
5205  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
5206  __Pyx_GOTREF(__pyx_t_3);
5207  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5208  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5209  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
5210  __Pyx_GOTREF(__pyx_t_2);
5211  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5212  __pyx_t_3 = PyNumber_Add(__pyx_cur_scope->__pyx_v_a0, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
5213  __Pyx_GOTREF(__pyx_t_3);
5214  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5215  __pyx_r = __pyx_t_3;
5216  __pyx_t_3 = 0;
5217  goto __pyx_L0;
5218 
5219  /* function exit code */
5220  __pyx_L1_error:;
5221  __Pyx_XDECREF(__pyx_t_1);
5222  __Pyx_XDECREF(__pyx_t_2);
5223  __Pyx_XDECREF(__pyx_t_3);
5224  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearBC.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
5225  __pyx_r = NULL;
5226  __pyx_L0:;
5227  __Pyx_XGIVEREF(__pyx_r);
5228  __Pyx_TraceReturn(__pyx_r, 0);
5229  __Pyx_RefNannyFinishContext();
5230  return __pyx_r;
5231 }
5232 
5233 /* "BoundaryConditions.py":100
5234  *
5235  *
5236  * def setLinearBC(self, a0, a): # <<<<<<<<<<<<<<
5237  * """
5238  * function returning value=a0+ax*x+ay*y+az*z
5239  */
5240 
5241 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_a0, PyObject *__pyx_v_a) {
5242  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_cur_scope;
5243  PyObject *__pyx_r = NULL;
5244  __Pyx_TraceDeclarations
5245  __Pyx_RefNannyDeclarations
5246  PyObject *__pyx_t_1 = NULL;
5247  PyObject *__pyx_t_2 = NULL;
5248  PyObject *__pyx_t_3 = NULL;
5249  PyObject *__pyx_t_4 = NULL;
5250  __Pyx_TraceFrameInit(__pyx_codeobj__8)
5251  __Pyx_RefNannySetupContext("setLinearBC", 0);
5252  __pyx_cur_scope = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(__pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, __pyx_empty_tuple, NULL);
5253  if (unlikely(!__pyx_cur_scope)) {
5254  __pyx_cur_scope = ((struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)Py_None);
5255  __Pyx_INCREF(Py_None);
5256  __PYX_ERR(0, 100, __pyx_L1_error)
5257  } else {
5258  __Pyx_GOTREF(__pyx_cur_scope);
5259  }
5260  __Pyx_TraceCall("setLinearBC", __pyx_f[0], 100, 0, __PYX_ERR(0, 100, __pyx_L1_error));
5261  __pyx_cur_scope->__pyx_v_a0 = __pyx_v_a0;
5262  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_a0);
5263  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_a0);
5264  __pyx_cur_scope->__pyx_v_a = __pyx_v_a;
5265  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_a);
5266  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_a);
5267 
5268  /* "BoundaryConditions.py":113
5269  * """
5270  *
5271  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:]) # <<<<<<<<<<<<<<
5272  *
5273  * def setLinearRamp(self,t1,value):
5274  */
5275  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1, 0, __pyx_n_s_setLinearBC_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_BoundaryConditions, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
5276  __Pyx_GOTREF(__pyx_t_1);
5277  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults1), 1)) __PYX_ERR(0, 113, __pyx_L1_error)
5278  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
5279  __Pyx_GOTREF(__pyx_t_3);
5280  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 113, __pyx_L1_error)
5281  __Pyx_GOTREF(__pyx_t_4);
5282  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5283  __pyx_t_3 = NULL;
5284  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5285  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
5286  if (likely(__pyx_t_3)) {
5287  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5288  __Pyx_INCREF(__pyx_t_3);
5289  __Pyx_INCREF(function);
5290  __Pyx_DECREF_SET(__pyx_t_4, function);
5291  }
5292  }
5293  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_3);
5294  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5295  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
5296  __Pyx_GOTREF(__pyx_t_2);
5297  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5298  __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_1)->__pyx_arg_n = __pyx_t_2;
5299  __Pyx_GIVEREF(__pyx_t_2);
5300  __pyx_t_2 = 0;
5301  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_18BoundaryConditions_4__defaults__);
5302  __Pyx_GIVEREF(__pyx_t_1);
5303  __Pyx_GOTREF(__pyx_v_self->uOfXT);
5304  __Pyx_DECREF(__pyx_v_self->uOfXT);
5305  __pyx_v_self->uOfXT = __pyx_t_1;
5306  __pyx_t_1 = 0;
5307 
5308  /* "BoundaryConditions.py":100
5309  *
5310  *
5311  * def setLinearBC(self, a0, a): # <<<<<<<<<<<<<<
5312  * """
5313  * function returning value=a0+ax*x+ay*y+az*z
5314  */
5315 
5316  /* function exit code */
5317  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5318  goto __pyx_L0;
5319  __pyx_L1_error:;
5320  __Pyx_XDECREF(__pyx_t_1);
5321  __Pyx_XDECREF(__pyx_t_2);
5322  __Pyx_XDECREF(__pyx_t_3);
5323  __Pyx_XDECREF(__pyx_t_4);
5324  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
5325  __pyx_r = NULL;
5326  __pyx_L0:;
5327  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
5328  __Pyx_XGIVEREF(__pyx_r);
5329  __Pyx_TraceReturn(__pyx_r, 0);
5330  __Pyx_RefNannyFinishContext();
5331  return __pyx_r;
5332 }
5333 
5334 /* "BoundaryConditions.py":115
5335  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:])
5336  *
5337  * def setLinearRamp(self,t1,value): # <<<<<<<<<<<<<<
5338  * """
5339  * function setting a linear ramp from t=0 to t=t1
5340  */
5341 
5342 /* Python wrapper */
5343 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5344 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_10setLinearRamp[] = "BoundaryCondition.setLinearRamp(self, t1, value)\n\n function setting a linear ramp from t=0 to t=t1\n\n Parameters\n -----------\n t1: float\n Ramp end time\n value: float\n Variable value\n ";
5345 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearRamp = {"setLinearRamp", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_10setLinearRamp};
5346 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5347  PyObject *__pyx_v_t1 = 0;
5348  PyObject *__pyx_v_value = 0;
5349  PyObject *__pyx_r = 0;
5350  __Pyx_RefNannyDeclarations
5351  __Pyx_RefNannySetupContext("setLinearRamp (wrapper)", 0);
5352  {
5353  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t1,&__pyx_n_s_value,0};
5354  PyObject* values[2] = {0,0};
5355  if (unlikely(__pyx_kwds)) {
5356  Py_ssize_t kw_args;
5357  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5358  switch (pos_args) {
5359  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5360  CYTHON_FALLTHROUGH;
5361  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5362  CYTHON_FALLTHROUGH;
5363  case 0: break;
5364  default: goto __pyx_L5_argtuple_error;
5365  }
5366  kw_args = PyDict_Size(__pyx_kwds);
5367  switch (pos_args) {
5368  case 0:
5369  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t1)) != 0)) kw_args--;
5370  else goto __pyx_L5_argtuple_error;
5371  CYTHON_FALLTHROUGH;
5372  case 1:
5373  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
5374  else {
5375  __Pyx_RaiseArgtupleInvalid("setLinearRamp", 1, 2, 2, 1); __PYX_ERR(0, 115, __pyx_L3_error)
5376  }
5377  }
5378  if (unlikely(kw_args > 0)) {
5379  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setLinearRamp") < 0)) __PYX_ERR(0, 115, __pyx_L3_error)
5380  }
5381  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5382  goto __pyx_L5_argtuple_error;
5383  } else {
5384  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5385  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5386  }
5387  __pyx_v_t1 = values[0];
5388  __pyx_v_value = values[1];
5389  }
5390  goto __pyx_L4_argument_unpacking_done;
5391  __pyx_L5_argtuple_error:;
5392  __Pyx_RaiseArgtupleInvalid("setLinearRamp", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 115, __pyx_L3_error)
5393  __pyx_L3_error:;
5394  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearRamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
5395  __Pyx_RefNannyFinishContext();
5396  return NULL;
5397  __pyx_L4_argument_unpacking_done:;
5398  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_10setLinearRamp(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), __pyx_v_t1, __pyx_v_value);
5399 
5400  /* function exit code */
5401  __Pyx_RefNannyFinishContext();
5402  return __pyx_r;
5403 }
5404 
5405 /* "BoundaryConditions.py":126
5406  * Variable value
5407  * """
5408  * self.uOfXT = lambda x, t, n=np.zeros(3,): min( t/t1, 1)*value # <<<<<<<<<<<<<<
5409  */
5410 
5411 static PyObject *__pyx_pf_18BoundaryConditions_6__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
5412  PyObject *__pyx_r = NULL;
5413  __Pyx_TraceDeclarations
5414  __Pyx_RefNannyDeclarations
5415  PyObject *__pyx_t_1 = NULL;
5416  PyObject *__pyx_t_2 = NULL;
5417  __Pyx_RefNannySetupContext("__defaults__", 0);
5418  __Pyx_TraceCall("__defaults__", __pyx_f[0], 126, 0, __PYX_ERR(0, 126, __pyx_L1_error));
5419  __Pyx_XDECREF(__pyx_r);
5420  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
5421  __Pyx_GOTREF(__pyx_t_1);
5422  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_n);
5423  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_n);
5424  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_n);
5425  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
5426  __Pyx_GOTREF(__pyx_t_2);
5427  __Pyx_GIVEREF(__pyx_t_1);
5428  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
5429  __Pyx_INCREF(Py_None);
5430  __Pyx_GIVEREF(Py_None);
5431  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
5432  __pyx_t_1 = 0;
5433  __pyx_r = __pyx_t_2;
5434  __pyx_t_2 = 0;
5435  goto __pyx_L0;
5436 
5437  /* function exit code */
5438  __pyx_L1_error:;
5439  __Pyx_XDECREF(__pyx_t_1);
5440  __Pyx_XDECREF(__pyx_t_2);
5441  __Pyx_AddTraceback("BoundaryConditions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5442  __pyx_r = NULL;
5443  __pyx_L0:;
5444  __Pyx_XGIVEREF(__pyx_r);
5445  __Pyx_TraceReturn(__pyx_r, 0);
5446  __Pyx_RefNannyFinishContext();
5447  return __pyx_r;
5448 }
5449 
5450 /* Python wrapper */
5451 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5452 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2 = {"lambda2", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2, METH_VARARGS|METH_KEYWORDS, 0};
5453 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5454  CYTHON_UNUSED PyObject *__pyx_v_x = 0;
5455  PyObject *__pyx_v_t = 0;
5456  CYTHON_UNUSED PyObject *__pyx_v_n = 0;
5457  PyObject *__pyx_r = 0;
5458  __Pyx_RefNannyDeclarations
5459  __Pyx_RefNannySetupContext("lambda2 (wrapper)", 0);
5460  {
5461  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,&__pyx_n_s_n,0};
5462  PyObject* values[3] = {0,0,0};
5463  __pyx_defaults2 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self);
5464  values[2] = __pyx_dynamic_args->__pyx_arg_n;
5465  if (unlikely(__pyx_kwds)) {
5466  Py_ssize_t kw_args;
5467  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5468  switch (pos_args) {
5469  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5470  CYTHON_FALLTHROUGH;
5471  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5472  CYTHON_FALLTHROUGH;
5473  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5474  CYTHON_FALLTHROUGH;
5475  case 0: break;
5476  default: goto __pyx_L5_argtuple_error;
5477  }
5478  kw_args = PyDict_Size(__pyx_kwds);
5479  switch (pos_args) {
5480  case 0:
5481  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5482  else goto __pyx_L5_argtuple_error;
5483  CYTHON_FALLTHROUGH;
5484  case 1:
5485  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5486  else {
5487  __Pyx_RaiseArgtupleInvalid("lambda2", 0, 2, 3, 1); __PYX_ERR(0, 126, __pyx_L3_error)
5488  }
5489  CYTHON_FALLTHROUGH;
5490  case 2:
5491  if (kw_args > 0) {
5492  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);
5493  if (value) { values[2] = value; kw_args--; }
5494  }
5495  }
5496  if (unlikely(kw_args > 0)) {
5497  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda2") < 0)) __PYX_ERR(0, 126, __pyx_L3_error)
5498  }
5499  } else {
5500  switch (PyTuple_GET_SIZE(__pyx_args)) {
5501  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5502  CYTHON_FALLTHROUGH;
5503  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5504  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5505  break;
5506  default: goto __pyx_L5_argtuple_error;
5507  }
5508  }
5509  __pyx_v_x = values[0];
5510  __pyx_v_t = values[1];
5511  __pyx_v_n = values[2];
5512  }
5513  goto __pyx_L4_argument_unpacking_done;
5514  __pyx_L5_argtuple_error:;
5515  __Pyx_RaiseArgtupleInvalid("lambda2", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 126, __pyx_L3_error)
5516  __pyx_L3_error:;
5517  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearRamp.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
5518  __Pyx_RefNannyFinishContext();
5519  return NULL;
5520  __pyx_L4_argument_unpacking_done:;
5521  __pyx_r = __pyx_lambda_funcdef_lambda2(__pyx_self, __pyx_v_x, __pyx_v_t, __pyx_v_n);
5522 
5523  /* function exit code */
5524  __Pyx_RefNannyFinishContext();
5525  return __pyx_r;
5526 }
5527 
5528 static PyObject *__pyx_lambda_funcdef_lambda2(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n) {
5529  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_cur_scope;
5530  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_outer_scope;
5531  PyObject *__pyx_r = NULL;
5532  __Pyx_TraceDeclarations
5533  __Pyx_RefNannyDeclarations
5534  long __pyx_t_1;
5535  PyObject *__pyx_t_2 = NULL;
5536  PyObject *__pyx_t_3 = NULL;
5537  PyObject *__pyx_t_4 = NULL;
5538  PyObject *__pyx_t_5 = NULL;
5539  int __pyx_t_6;
5540  __Pyx_RefNannySetupContext("lambda2", 0);
5541  __pyx_outer_scope = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *) __Pyx_CyFunction_GetClosure(__pyx_self);
5542  __pyx_cur_scope = __pyx_outer_scope;
5543  __Pyx_TraceCall("lambda2", __pyx_f[0], 126, 0, __PYX_ERR(0, 126, __pyx_L1_error));
5544  __Pyx_XDECREF(__pyx_r);
5545  __pyx_t_1 = 1;
5546  if (unlikely(!__pyx_cur_scope->__pyx_v_t1)) { __Pyx_RaiseClosureNameError("t1"); __PYX_ERR(0, 126, __pyx_L1_error) }
5547  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_t, __pyx_cur_scope->__pyx_v_t1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
5548  __Pyx_GOTREF(__pyx_t_2);
5549  __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error)
5550  __Pyx_GOTREF(__pyx_t_4);
5551  __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error)
5552  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5553  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 126, __pyx_L1_error)
5554  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5555  if (__pyx_t_6) {
5556  __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error)
5557  __Pyx_GOTREF(__pyx_t_5);
5558  __pyx_t_3 = __pyx_t_5;
5559  __pyx_t_5 = 0;
5560  } else {
5561  __Pyx_INCREF(__pyx_t_2);
5562  __pyx_t_3 = __pyx_t_2;
5563  }
5564  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5565  if (unlikely(!__pyx_cur_scope->__pyx_v_value)) { __Pyx_RaiseClosureNameError("value"); __PYX_ERR(0, 126, __pyx_L1_error) }
5566  __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_cur_scope->__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
5567  __Pyx_GOTREF(__pyx_t_2);
5568  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5569  __pyx_r = __pyx_t_2;
5570  __pyx_t_2 = 0;
5571  goto __pyx_L0;
5572 
5573  /* function exit code */
5574  __pyx_L1_error:;
5575  __Pyx_XDECREF(__pyx_t_2);
5576  __Pyx_XDECREF(__pyx_t_3);
5577  __Pyx_XDECREF(__pyx_t_4);
5578  __Pyx_XDECREF(__pyx_t_5);
5579  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearRamp.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
5580  __pyx_r = NULL;
5581  __pyx_L0:;
5582  __Pyx_XGIVEREF(__pyx_r);
5583  __Pyx_TraceReturn(__pyx_r, 0);
5584  __Pyx_RefNannyFinishContext();
5585  return __pyx_r;
5586 }
5587 
5588 /* "BoundaryConditions.py":115
5589  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:])
5590  *
5591  * def setLinearRamp(self,t1,value): # <<<<<<<<<<<<<<
5592  * """
5593  * function setting a linear ramp from t=0 to t=t1
5594  */
5595 
5596 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_10setLinearRamp(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_t1, PyObject *__pyx_v_value) {
5597  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_cur_scope;
5598  PyObject *__pyx_r = NULL;
5599  __Pyx_TraceDeclarations
5600  __Pyx_RefNannyDeclarations
5601  PyObject *__pyx_t_1 = NULL;
5602  PyObject *__pyx_t_2 = NULL;
5603  PyObject *__pyx_t_3 = NULL;
5604  PyObject *__pyx_t_4 = NULL;
5605  __Pyx_TraceFrameInit(__pyx_codeobj__9)
5606  __Pyx_RefNannySetupContext("setLinearRamp", 0);
5607  __pyx_cur_scope = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(__pyx_ptype_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp, __pyx_empty_tuple, NULL);
5608  if (unlikely(!__pyx_cur_scope)) {
5609  __pyx_cur_scope = ((struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)Py_None);
5610  __Pyx_INCREF(Py_None);
5611  __PYX_ERR(0, 115, __pyx_L1_error)
5612  } else {
5613  __Pyx_GOTREF(__pyx_cur_scope);
5614  }
5615  __Pyx_TraceCall("setLinearRamp", __pyx_f[0], 115, 0, __PYX_ERR(0, 115, __pyx_L1_error));
5616  __pyx_cur_scope->__pyx_v_t1 = __pyx_v_t1;
5617  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_t1);
5618  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_t1);
5619  __pyx_cur_scope->__pyx_v_value = __pyx_v_value;
5620  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
5621  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value);
5622 
5623  /* "BoundaryConditions.py":126
5624  * Variable value
5625  * """
5626  * self.uOfXT = lambda x, t, n=np.zeros(3,): min( t/t1, 1)*value # <<<<<<<<<<<<<<
5627  */
5628  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2, 0, __pyx_n_s_setLinearRamp_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_BoundaryConditions, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
5629  __Pyx_GOTREF(__pyx_t_1);
5630  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults2), 1)) __PYX_ERR(0, 126, __pyx_L1_error)
5631  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error)
5632  __Pyx_GOTREF(__pyx_t_3);
5633  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error)
5634  __Pyx_GOTREF(__pyx_t_4);
5635  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5636  __pyx_t_3 = NULL;
5637  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5638  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
5639  if (likely(__pyx_t_3)) {
5640  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5641  __Pyx_INCREF(__pyx_t_3);
5642  __Pyx_INCREF(function);
5643  __Pyx_DECREF_SET(__pyx_t_4, function);
5644  }
5645  }
5646  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_3);
5647  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5648  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
5649  __Pyx_GOTREF(__pyx_t_2);
5650  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5651  __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_t_1)->__pyx_arg_n = __pyx_t_2;
5652  __Pyx_GIVEREF(__pyx_t_2);
5653  __pyx_t_2 = 0;
5654  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_18BoundaryConditions_6__defaults__);
5655  __Pyx_GIVEREF(__pyx_t_1);
5656  __Pyx_GOTREF(__pyx_v_self->uOfXT);
5657  __Pyx_DECREF(__pyx_v_self->uOfXT);
5658  __pyx_v_self->uOfXT = __pyx_t_1;
5659  __pyx_t_1 = 0;
5660 
5661  /* "BoundaryConditions.py":115
5662  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:])
5663  *
5664  * def setLinearRamp(self,t1,value): # <<<<<<<<<<<<<<
5665  * """
5666  * function setting a linear ramp from t=0 to t=t1
5667  */
5668 
5669  /* function exit code */
5670  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5671  goto __pyx_L0;
5672  __pyx_L1_error:;
5673  __Pyx_XDECREF(__pyx_t_1);
5674  __Pyx_XDECREF(__pyx_t_2);
5675  __Pyx_XDECREF(__pyx_t_3);
5676  __Pyx_XDECREF(__pyx_t_4);
5677  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearRamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
5678  __pyx_r = NULL;
5679  __pyx_L0:;
5680  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
5681  __Pyx_XGIVEREF(__pyx_r);
5682  __Pyx_TraceReturn(__pyx_r, 0);
5683  __Pyx_RefNannyFinishContext();
5684  return __pyx_r;
5685 }
5686 
5687 /* "BoundaryConditions.pxd":20
5688  * cdef cpp_uOfXT uuOfXT
5689  * cdef public:
5690  * object uOfXT # <<<<<<<<<<<<<<
5691  * cpdef void resetBC(self)
5692  * # cpdef void setConstantBC(self, double value)
5693  */
5694 
5695 /* Python wrapper */
5696 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(PyObject *__pyx_v_self); /*proto*/
5697 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(PyObject *__pyx_v_self) {
5698  PyObject *__pyx_r = 0;
5699  __Pyx_RefNannyDeclarations
5700  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
5701  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
5702 
5703  /* function exit code */
5704  __Pyx_RefNannyFinishContext();
5705  return __pyx_r;
5706 }
5707 
5708 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
5709  PyObject *__pyx_r = NULL;
5710  __Pyx_TraceDeclarations
5711  __Pyx_RefNannyDeclarations
5712  __Pyx_RefNannySetupContext("__get__", 0);
5713  __Pyx_TraceCall("__get__", __pyx_f[2], 20, 0, __PYX_ERR(2, 20, __pyx_L1_error));
5714  __Pyx_XDECREF(__pyx_r);
5715  __Pyx_INCREF(__pyx_v_self->uOfXT);
5716  __pyx_r = __pyx_v_self->uOfXT;
5717  goto __pyx_L0;
5718 
5719  /* function exit code */
5720  __pyx_L1_error:;
5721  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.uOfXT.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5722  __pyx_r = NULL;
5723  __pyx_L0:;
5724  __Pyx_XGIVEREF(__pyx_r);
5725  __Pyx_TraceReturn(__pyx_r, 0);
5726  __Pyx_RefNannyFinishContext();
5727  return __pyx_r;
5728 }
5729 
5730 /* Python wrapper */
5731 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
5732 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
5733  int __pyx_r;
5734  __Pyx_RefNannyDeclarations
5735  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
5736  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v_value));
5737 
5738  /* function exit code */
5739  __Pyx_RefNannyFinishContext();
5740  return __pyx_r;
5741 }
5742 
5743 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value) {
5744  int __pyx_r;
5745  __Pyx_TraceDeclarations
5746  __Pyx_RefNannyDeclarations
5747  __Pyx_RefNannySetupContext("__set__", 0);
5748  __Pyx_TraceCall("__set__", __pyx_f[2], 20, 0, __PYX_ERR(2, 20, __pyx_L1_error));
5749  __Pyx_INCREF(__pyx_v_value);
5750  __Pyx_GIVEREF(__pyx_v_value);
5751  __Pyx_GOTREF(__pyx_v_self->uOfXT);
5752  __Pyx_DECREF(__pyx_v_self->uOfXT);
5753  __pyx_v_self->uOfXT = __pyx_v_value;
5754 
5755  /* function exit code */
5756  __pyx_r = 0;
5757  goto __pyx_L0;
5758  __pyx_L1_error:;
5759  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.uOfXT.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5760  __pyx_r = -1;
5761  __pyx_L0:;
5762  __Pyx_TraceReturn(Py_None, 0);
5763  __Pyx_RefNannyFinishContext();
5764  return __pyx_r;
5765 }
5766 
5767 /* Python wrapper */
5768 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(PyObject *__pyx_v_self); /*proto*/
5769 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(PyObject *__pyx_v_self) {
5770  int __pyx_r;
5771  __Pyx_RefNannyDeclarations
5772  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
5773  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
5774 
5775  /* function exit code */
5776  __Pyx_RefNannyFinishContext();
5777  return __pyx_r;
5778 }
5779 
5780 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
5781  int __pyx_r;
5782  __Pyx_TraceDeclarations
5783  __Pyx_RefNannyDeclarations
5784  __Pyx_RefNannySetupContext("__del__", 0);
5785  __Pyx_TraceCall("__del__", __pyx_f[2], 20, 0, __PYX_ERR(2, 20, __pyx_L1_error));
5786  __Pyx_INCREF(Py_None);
5787  __Pyx_GIVEREF(Py_None);
5788  __Pyx_GOTREF(__pyx_v_self->uOfXT);
5789  __Pyx_DECREF(__pyx_v_self->uOfXT);
5790  __pyx_v_self->uOfXT = Py_None;
5791 
5792  /* function exit code */
5793  __pyx_r = 0;
5794  goto __pyx_L0;
5795  __pyx_L1_error:;
5796  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.uOfXT.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5797  __pyx_r = -1;
5798  __pyx_L0:;
5799  __Pyx_TraceReturn(Py_None, 0);
5800  __Pyx_RefNannyFinishContext();
5801  return __pyx_r;
5802 }
5803 
5804 /* "(tree fragment)":1
5805  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5806  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
5807  * def __setstate_cython__(self, __pyx_state):
5808  */
5809 
5810 /* Python wrapper */
5811 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
5812 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__[] = "BoundaryCondition.__reduce_cython__(self)";
5813 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__};
5814 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5815  PyObject *__pyx_r = 0;
5816  __Pyx_RefNannyDeclarations
5817  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
5818  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
5819 
5820  /* function exit code */
5821  __Pyx_RefNannyFinishContext();
5822  return __pyx_r;
5823 }
5824 
5825 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
5826  PyObject *__pyx_r = NULL;
5827  __Pyx_TraceDeclarations
5828  __Pyx_RefNannyDeclarations
5829  PyObject *__pyx_t_1 = NULL;
5830  __Pyx_TraceFrameInit(__pyx_codeobj__10)
5831  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
5832  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
5833 
5834  /* "(tree fragment)":2
5835  * def __reduce_cython__(self):
5836  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
5837  * def __setstate_cython__(self, __pyx_state):
5838  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
5839  */
5840  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
5841  __Pyx_GOTREF(__pyx_t_1);
5842  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5843  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5844  __PYX_ERR(1, 2, __pyx_L1_error)
5845 
5846  /* "(tree fragment)":1
5847  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5848  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
5849  * def __setstate_cython__(self, __pyx_state):
5850  */
5851 
5852  /* function exit code */
5853  __pyx_L1_error:;
5854  __Pyx_XDECREF(__pyx_t_1);
5855  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5856  __pyx_r = NULL;
5857  __Pyx_XGIVEREF(__pyx_r);
5858  __Pyx_TraceReturn(__pyx_r, 0);
5859  __Pyx_RefNannyFinishContext();
5860  return __pyx_r;
5861 }
5862 
5863 /* "(tree fragment)":3
5864  * def __reduce_cython__(self):
5865  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
5866  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
5867  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
5868  */
5869 
5870 /* Python wrapper */
5871 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
5872 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__[] = "BoundaryCondition.__setstate_cython__(self, __pyx_state)";
5873 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__};
5874 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5875  PyObject *__pyx_r = 0;
5876  __Pyx_RefNannyDeclarations
5877  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
5878  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
5879 
5880  /* function exit code */
5881  __Pyx_RefNannyFinishContext();
5882  return __pyx_r;
5883 }
5884 
5885 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
5886  PyObject *__pyx_r = NULL;
5887  __Pyx_TraceDeclarations
5888  __Pyx_RefNannyDeclarations
5889  PyObject *__pyx_t_1 = NULL;
5890  __Pyx_TraceFrameInit(__pyx_codeobj__12)
5891  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
5892  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
5893 
5894  /* "(tree fragment)":4
5895  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
5896  * def __setstate_cython__(self, __pyx_state):
5897  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
5898  */
5899  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
5900  __Pyx_GOTREF(__pyx_t_1);
5901  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5902  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5903  __PYX_ERR(1, 4, __pyx_L1_error)
5904 
5905  /* "(tree fragment)":3
5906  * def __reduce_cython__(self):
5907  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
5908  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
5909  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
5910  */
5911 
5912  /* function exit code */
5913  __pyx_L1_error:;
5914  __Pyx_XDECREF(__pyx_t_1);
5915  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5916  __pyx_r = NULL;
5917  __Pyx_XGIVEREF(__pyx_r);
5918  __Pyx_TraceReturn(__pyx_r, 0);
5919  __Pyx_RefNannyFinishContext();
5920  return __pyx_r;
5921 }
5922 
5923 /* "(tree fragment)":1
5924  * def __pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
5925  * cdef object __pyx_PickleError
5926  * cdef object __pyx_result
5927  */
5928 
5929 /* Python wrapper */
5930 static PyObject *__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5931 static char __pyx_doc_18BoundaryConditions___pyx_unpickle_BC_Base[] = "__pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state)";
5932 static PyMethodDef __pyx_mdef_18BoundaryConditions_1__pyx_unpickle_BC_Base = {"__pyx_unpickle_BC_Base", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions___pyx_unpickle_BC_Base};
5933 static PyObject *__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5934  PyObject *__pyx_v___pyx_type = 0;
5935  long __pyx_v___pyx_checksum;
5936  PyObject *__pyx_v___pyx_state = 0;
5937  PyObject *__pyx_r = 0;
5938  __Pyx_RefNannyDeclarations
5939  __Pyx_RefNannySetupContext("__pyx_unpickle_BC_Base (wrapper)", 0);
5940  {
5941  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
5942  PyObject* values[3] = {0,0,0};
5943  if (unlikely(__pyx_kwds)) {
5944  Py_ssize_t kw_args;
5945  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5946  switch (pos_args) {
5947  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5948  CYTHON_FALLTHROUGH;
5949  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5950  CYTHON_FALLTHROUGH;
5951  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5952  CYTHON_FALLTHROUGH;
5953  case 0: break;
5954  default: goto __pyx_L5_argtuple_error;
5955  }
5956  kw_args = PyDict_Size(__pyx_kwds);
5957  switch (pos_args) {
5958  case 0:
5959  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
5960  else goto __pyx_L5_argtuple_error;
5961  CYTHON_FALLTHROUGH;
5962  case 1:
5963  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
5964  else {
5965  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BC_Base", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
5966  }
5967  CYTHON_FALLTHROUGH;
5968  case 2:
5969  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
5970  else {
5971  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BC_Base", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
5972  }
5973  }
5974  if (unlikely(kw_args > 0)) {
5975  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_BC_Base") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
5976  }
5977  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
5978  goto __pyx_L5_argtuple_error;
5979  } else {
5980  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5981  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5982  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5983  }
5984  __pyx_v___pyx_type = values[0];
5985  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
5986  __pyx_v___pyx_state = values[2];
5987  }
5988  goto __pyx_L4_argument_unpacking_done;
5989  __pyx_L5_argtuple_error:;
5990  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BC_Base", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
5991  __pyx_L3_error:;
5992  __Pyx_AddTraceback("BoundaryConditions.__pyx_unpickle_BC_Base", __pyx_clineno, __pyx_lineno, __pyx_filename);
5993  __Pyx_RefNannyFinishContext();
5994  return NULL;
5995  __pyx_L4_argument_unpacking_done:;
5996  __pyx_r = __pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
5997 
5998  /* function exit code */
5999  __Pyx_RefNannyFinishContext();
6000  return __pyx_r;
6001 }
6002 
6003 static PyObject *__pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
6004  PyObject *__pyx_v___pyx_PickleError = 0;
6005  PyObject *__pyx_v___pyx_result = 0;
6006  PyObject *__pyx_r = NULL;
6007  __Pyx_TraceDeclarations
6008  __Pyx_RefNannyDeclarations
6009  int __pyx_t_1;
6010  PyObject *__pyx_t_2 = NULL;
6011  PyObject *__pyx_t_3 = NULL;
6012  PyObject *__pyx_t_4 = NULL;
6013  PyObject *__pyx_t_5 = NULL;
6014  int __pyx_t_6;
6015  __Pyx_TraceFrameInit(__pyx_codeobj__14)
6016  __Pyx_RefNannySetupContext("__pyx_unpickle_BC_Base", 0);
6017  __Pyx_TraceCall("__pyx_unpickle_BC_Base", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
6018 
6019  /* "(tree fragment)":4
6020  * cdef object __pyx_PickleError
6021  * cdef object __pyx_result
6022  * if __pyx_checksum != 0x96e6a1f: # <<<<<<<<<<<<<<
6023  * from pickle import PickleError as __pyx_PickleError
6024  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
6025  */
6026  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x96e6a1f) != 0);
6027  if (__pyx_t_1) {
6028 
6029  /* "(tree fragment)":5
6030  * cdef object __pyx_result
6031  * if __pyx_checksum != 0x96e6a1f:
6032  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
6033  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
6034  * __pyx_result = BC_Base.__new__(__pyx_type)
6035  */
6036  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
6037  __Pyx_GOTREF(__pyx_t_2);
6038  __Pyx_INCREF(__pyx_n_s_PickleError);
6039  __Pyx_GIVEREF(__pyx_n_s_PickleError);
6040  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
6041  __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
6042  __Pyx_GOTREF(__pyx_t_3);
6043  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6044  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
6045  __Pyx_GOTREF(__pyx_t_2);
6046  __Pyx_INCREF(__pyx_t_2);
6047  __pyx_v___pyx_PickleError = __pyx_t_2;
6048  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6049  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6050 
6051  /* "(tree fragment)":6
6052  * if __pyx_checksum != 0x96e6a1f:
6053  * from pickle import PickleError as __pyx_PickleError
6054  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum) # <<<<<<<<<<<<<<
6055  * __pyx_result = BC_Base.__new__(__pyx_type)
6056  * if __pyx_state is not None:
6057  */
6058  __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
6059  __Pyx_GOTREF(__pyx_t_2);
6060  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x96, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
6061  __Pyx_GOTREF(__pyx_t_4);
6062  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6063  __Pyx_INCREF(__pyx_v___pyx_PickleError);
6064  __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
6065  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
6066  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
6067  if (likely(__pyx_t_5)) {
6068  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6069  __Pyx_INCREF(__pyx_t_5);
6070  __Pyx_INCREF(function);
6071  __Pyx_DECREF_SET(__pyx_t_2, function);
6072  }
6073  }
6074  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
6075  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
6076  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6077  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
6078  __Pyx_GOTREF(__pyx_t_3);
6079  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6080  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6081  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6082  __PYX_ERR(1, 6, __pyx_L1_error)
6083 
6084  /* "(tree fragment)":4
6085  * cdef object __pyx_PickleError
6086  * cdef object __pyx_result
6087  * if __pyx_checksum != 0x96e6a1f: # <<<<<<<<<<<<<<
6088  * from pickle import PickleError as __pyx_PickleError
6089  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
6090  */
6091  }
6092 
6093  /* "(tree fragment)":7
6094  * from pickle import PickleError as __pyx_PickleError
6095  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
6096  * __pyx_result = BC_Base.__new__(__pyx_type) # <<<<<<<<<<<<<<
6097  * if __pyx_state is not None:
6098  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
6099  */
6100  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
6101  __Pyx_GOTREF(__pyx_t_2);
6102  __pyx_t_4 = NULL;
6103  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
6104  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
6105  if (likely(__pyx_t_4)) {
6106  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6107  __Pyx_INCREF(__pyx_t_4);
6108  __Pyx_INCREF(function);
6109  __Pyx_DECREF_SET(__pyx_t_2, function);
6110  }
6111  }
6112  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
6113  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6114  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
6115  __Pyx_GOTREF(__pyx_t_3);
6116  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6117  __pyx_v___pyx_result = __pyx_t_3;
6118  __pyx_t_3 = 0;
6119 
6120  /* "(tree fragment)":8
6121  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
6122  * __pyx_result = BC_Base.__new__(__pyx_type)
6123  * if __pyx_state is not None: # <<<<<<<<<<<<<<
6124  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
6125  * return __pyx_result
6126  */
6127  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
6128  __pyx_t_6 = (__pyx_t_1 != 0);
6129  if (__pyx_t_6) {
6130 
6131  /* "(tree fragment)":9
6132  * __pyx_result = BC_Base.__new__(__pyx_type)
6133  * if __pyx_state is not None:
6134  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
6135  * return __pyx_result
6136  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state):
6137  */
6138  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
6139  __pyx_t_3 = __pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
6140  __Pyx_GOTREF(__pyx_t_3);
6141  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6142 
6143  /* "(tree fragment)":8
6144  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
6145  * __pyx_result = BC_Base.__new__(__pyx_type)
6146  * if __pyx_state is not None: # <<<<<<<<<<<<<<
6147  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
6148  * return __pyx_result
6149  */
6150  }
6151 
6152  /* "(tree fragment)":10
6153  * if __pyx_state is not None:
6154  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
6155  * return __pyx_result # <<<<<<<<<<<<<<
6156  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state):
6157  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
6158  */
6159  __Pyx_XDECREF(__pyx_r);
6160  __Pyx_INCREF(__pyx_v___pyx_result);
6161  __pyx_r = __pyx_v___pyx_result;
6162  goto __pyx_L0;
6163 
6164  /* "(tree fragment)":1
6165  * def __pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
6166  * cdef object __pyx_PickleError
6167  * cdef object __pyx_result
6168  */
6169 
6170  /* function exit code */
6171  __pyx_L1_error:;
6172  __Pyx_XDECREF(__pyx_t_2);
6173  __Pyx_XDECREF(__pyx_t_3);
6174  __Pyx_XDECREF(__pyx_t_4);
6175  __Pyx_XDECREF(__pyx_t_5);
6176  __Pyx_AddTraceback("BoundaryConditions.__pyx_unpickle_BC_Base", __pyx_clineno, __pyx_lineno, __pyx_filename);
6177  __pyx_r = NULL;
6178  __pyx_L0:;
6179  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
6180  __Pyx_XDECREF(__pyx_v___pyx_result);
6181  __Pyx_XGIVEREF(__pyx_r);
6182  __Pyx_TraceReturn(__pyx_r, 0);
6183  __Pyx_RefNannyFinishContext();
6184  return __pyx_r;
6185 }
6186 
6187 /* "(tree fragment)":11
6188  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
6189  * return __pyx_result
6190  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
6191  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
6192  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
6193  */
6194 
6195 static PyObject *__pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
6196  PyObject *__pyx_r = NULL;
6197  __Pyx_TraceDeclarations
6198  __Pyx_RefNannyDeclarations
6199  PyObject *__pyx_t_1 = NULL;
6200  __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
6201  int __pyx_t_3;
6202  int __pyx_t_4;
6203  Py_ssize_t __pyx_t_5;
6204  int __pyx_t_6;
6205  int __pyx_t_7;
6206  PyObject *__pyx_t_8 = NULL;
6207  PyObject *__pyx_t_9 = NULL;
6208  __Pyx_RefNannySetupContext("__pyx_unpickle_BC_Base__set_state", 0);
6209  __Pyx_TraceCall("__pyx_unpickle_BC_Base__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error));
6210 
6211  /* "(tree fragment)":12
6212  * return __pyx_result
6213  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state):
6214  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5] # <<<<<<<<<<<<<<
6215  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
6216  * __pyx_result.__dict__.update(__pyx_state[6])
6217  */
6218  if (unlikely(__pyx_v___pyx_state == Py_None)) {
6219  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6220  __PYX_ERR(1, 12, __pyx_L1_error)
6221  }
6222  if (!(likely(PyString_CheckExact(PyTuple_GET_ITEM(__pyx_v___pyx_state, 0)))||((PyTuple_GET_ITEM(__pyx_v___pyx_state, 0)) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(PyTuple_GET_ITEM(__pyx_v___pyx_state, 0))->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
6223  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v___pyx_state, 0);
6224  __Pyx_INCREF(__pyx_t_1);
6225  __Pyx_GIVEREF(__pyx_t_1);
6226  __Pyx_GOTREF(__pyx_v___pyx_result->BC_type);
6227  __Pyx_DECREF(__pyx_v___pyx_result->BC_type);
6228  __pyx_v___pyx_result->BC_type = ((PyObject*)__pyx_t_1);
6229  __pyx_t_1 = 0;
6230  if (unlikely(__pyx_v___pyx_state == Py_None)) {
6231  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6232  __PYX_ERR(1, 12, __pyx_L1_error)
6233  }
6234  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v___pyx_state, 1);
6235  __Pyx_INCREF(__pyx_t_1);
6236  __Pyx_GIVEREF(__pyx_t_1);
6237  __Pyx_GOTREF(__pyx_v___pyx_result->Shape);
6238  __Pyx_DECREF(__pyx_v___pyx_result->Shape);
6239  __pyx_v___pyx_result->Shape = __pyx_t_1;
6240  __pyx_t_1 = 0;
6241  if (unlikely(__pyx_v___pyx_state == Py_None)) {
6242  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6243  __PYX_ERR(1, 12, __pyx_L1_error)
6244  }
6245  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyTuple_GET_ITEM(__pyx_v___pyx_state, 2), PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(1, 12, __pyx_L1_error)
6246  __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->_b_or, 0);
6247  __pyx_v___pyx_result->_b_or = __pyx_t_2;
6248  __pyx_t_2.memview = NULL;
6249  __pyx_t_2.data = NULL;
6250  if (unlikely(__pyx_v___pyx_state == Py_None)) {
6251  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6252  __PYX_ERR(1, 12, __pyx_L1_error)
6253  }
6254  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v___pyx_state, 3);
6255  __Pyx_INCREF(__pyx_t_1);
6256  __Pyx_GIVEREF(__pyx_t_1);
6257  __Pyx_GOTREF(__pyx_v___pyx_result->ct);
6258  __Pyx_DECREF(__pyx_v___pyx_result->ct);
6259  __pyx_v___pyx_result->ct = __pyx_t_1;
6260  __pyx_t_1 = 0;
6261  if (unlikely(__pyx_v___pyx_state == Py_None)) {
6262  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6263  __PYX_ERR(1, 12, __pyx_L1_error)
6264  }
6265  if (!(likely(PyString_CheckExact(PyTuple_GET_ITEM(__pyx_v___pyx_state, 4)))||((PyTuple_GET_ITEM(__pyx_v___pyx_state, 4)) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(PyTuple_GET_ITEM(__pyx_v___pyx_state, 4))->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
6266  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v___pyx_state, 4);
6267  __Pyx_INCREF(__pyx_t_1);
6268  __Pyx_GIVEREF(__pyx_t_1);
6269  __Pyx_GOTREF(__pyx_v___pyx_result->name);
6270  __Pyx_DECREF(__pyx_v___pyx_result->name);
6271  __pyx_v___pyx_result->name = ((PyObject*)__pyx_t_1);
6272  __pyx_t_1 = 0;
6273  if (unlikely(__pyx_v___pyx_state == Py_None)) {
6274  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6275  __PYX_ERR(1, 12, __pyx_L1_error)
6276  }
6277  __pyx_t_3 = __Pyx_PyInt_As_int(PyTuple_GET_ITEM(__pyx_v___pyx_state, 5)); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
6278  __pyx_v___pyx_result->nd = __pyx_t_3;
6279 
6280  /* "(tree fragment)":13
6281  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state):
6282  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
6283  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
6284  * __pyx_result.__dict__.update(__pyx_state[6])
6285  */
6286  if (unlikely(__pyx_v___pyx_state == Py_None)) {
6287  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
6288  __PYX_ERR(1, 13, __pyx_L1_error)
6289  }
6290  __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
6291  __pyx_t_6 = ((__pyx_t_5 > 6) != 0);
6292  if (__pyx_t_6) {
6293  } else {
6294  __pyx_t_4 = __pyx_t_6;
6295  goto __pyx_L4_bool_binop_done;
6296  }
6297  __pyx_t_6 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
6298  __pyx_t_7 = (__pyx_t_6 != 0);
6299  __pyx_t_4 = __pyx_t_7;
6300  __pyx_L4_bool_binop_done:;
6301  if (__pyx_t_4) {
6302 
6303  /* "(tree fragment)":14
6304  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
6305  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
6306  * __pyx_result.__dict__.update(__pyx_state[6]) # <<<<<<<<<<<<<<
6307  */
6308  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
6309  __Pyx_GOTREF(__pyx_t_8);
6310  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_update); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 14, __pyx_L1_error)
6311  __Pyx_GOTREF(__pyx_t_9);
6312  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6313  if (unlikely(__pyx_v___pyx_state == Py_None)) {
6314  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6315  __PYX_ERR(1, 14, __pyx_L1_error)
6316  }
6317  __pyx_t_8 = NULL;
6318  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
6319  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
6320  if (likely(__pyx_t_8)) {
6321  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
6322  __Pyx_INCREF(__pyx_t_8);
6323  __Pyx_INCREF(function);
6324  __Pyx_DECREF_SET(__pyx_t_9, function);
6325  }
6326  }
6327  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_8, PyTuple_GET_ITEM(__pyx_v___pyx_state, 6)) : __Pyx_PyObject_CallOneArg(__pyx_t_9, PyTuple_GET_ITEM(__pyx_v___pyx_state, 6));
6328  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6329  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
6330  __Pyx_GOTREF(__pyx_t_1);
6331  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
6332  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6333 
6334  /* "(tree fragment)":13
6335  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state):
6336  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
6337  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
6338  * __pyx_result.__dict__.update(__pyx_state[6])
6339  */
6340  }
6341 
6342  /* "(tree fragment)":11
6343  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
6344  * return __pyx_result
6345  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
6346  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
6347  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
6348  */
6349 
6350  /* function exit code */
6351  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6352  goto __pyx_L0;
6353  __pyx_L1_error:;
6354  __Pyx_XDECREF(__pyx_t_1);
6355  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
6356  __Pyx_XDECREF(__pyx_t_8);
6357  __Pyx_XDECREF(__pyx_t_9);
6358  __Pyx_AddTraceback("BoundaryConditions.__pyx_unpickle_BC_Base__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
6359  __pyx_r = 0;
6360  __pyx_L0:;
6361  __Pyx_XGIVEREF(__pyx_r);
6362  __Pyx_TraceReturn(__pyx_r, 0);
6363  __Pyx_RefNannyFinishContext();
6364  return __pyx_r;
6365 }
6366 
6367 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":258
6368  * # experimental exception made for __getbuffer__ and __releasebuffer__
6369  * # -- the details of this may change.
6370  * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
6371  * # This implementation of getbuffer is geared towards Cython
6372  * # requirements, and does not yet fulfill the PEP.
6373  */
6374 
6375 /* Python wrapper */
6376 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
6377 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
6378  int __pyx_r;
6379  __Pyx_RefNannyDeclarations
6380  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
6381  __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
6382 
6383  /* function exit code */
6384  __Pyx_RefNannyFinishContext();
6385  return __pyx_r;
6386 }
6387 
6388 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
6389  int __pyx_v_i;
6390  int __pyx_v_ndim;
6391  int __pyx_v_endian_detector;
6392  int __pyx_v_little_endian;
6393  int __pyx_v_t;
6394  char *__pyx_v_f;
6395  PyArray_Descr *__pyx_v_descr = 0;
6396  int __pyx_v_offset;
6397  int __pyx_r;
6398  __Pyx_TraceDeclarations
6399  __Pyx_RefNannyDeclarations
6400  int __pyx_t_1;
6401  int __pyx_t_2;
6402  PyObject *__pyx_t_3 = NULL;
6403  int __pyx_t_4;
6404  int __pyx_t_5;
6405  int __pyx_t_6;
6406  PyArray_Descr *__pyx_t_7;
6407  PyObject *__pyx_t_8 = NULL;
6408  char *__pyx_t_9;
6409  if (__pyx_v_info == NULL) {
6410  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
6411  return -1;
6412  }
6413  __Pyx_RefNannySetupContext("__getbuffer__", 0);
6414  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
6415  __Pyx_GIVEREF(__pyx_v_info->obj);
6416  __Pyx_TraceCall("__getbuffer__", __pyx_f[3], 258, 0, __PYX_ERR(3, 258, __pyx_L1_error));
6417 
6418  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":265
6419  *
6420  * cdef int i, ndim
6421  * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
6422  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
6423  *
6424  */
6425  __pyx_v_endian_detector = 1;
6426 
6427  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":266
6428  * cdef int i, ndim
6429  * cdef int endian_detector = 1
6430  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
6431  *
6432  * ndim = PyArray_NDIM(self)
6433  */
6434  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
6435 
6436  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":268
6437  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
6438  *
6439  * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
6440  *
6441  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
6442  */
6443  __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
6444 
6445  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
6446  * ndim = PyArray_NDIM(self)
6447  *
6448  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
6449  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
6450  * raise ValueError(u"ndarray is not C contiguous")
6451  */
6452  __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
6453  if (__pyx_t_2) {
6454  } else {
6455  __pyx_t_1 = __pyx_t_2;
6456  goto __pyx_L4_bool_binop_done;
6457  }
6458 
6459  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":271
6460  *
6461  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
6462  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
6463  * raise ValueError(u"ndarray is not C contiguous")
6464  *
6465  */
6466  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_C_CONTIGUOUS) != 0)) != 0);
6467  __pyx_t_1 = __pyx_t_2;
6468  __pyx_L4_bool_binop_done:;
6469 
6470  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
6471  * ndim = PyArray_NDIM(self)
6472  *
6473  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
6474  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
6475  * raise ValueError(u"ndarray is not C contiguous")
6476  */
6477  if (unlikely(__pyx_t_1)) {
6478 
6479  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
6480  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
6481  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
6482  * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
6483  *
6484  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
6485  */
6486  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 272, __pyx_L1_error)
6487  __Pyx_GOTREF(__pyx_t_3);
6488  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6489  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6490  __PYX_ERR(3, 272, __pyx_L1_error)
6491 
6492  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
6493  * ndim = PyArray_NDIM(self)
6494  *
6495  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
6496  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
6497  * raise ValueError(u"ndarray is not C contiguous")
6498  */
6499  }
6500 
6501  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
6502  * raise ValueError(u"ndarray is not C contiguous")
6503  *
6504  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
6505  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
6506  * raise ValueError(u"ndarray is not Fortran contiguous")
6507  */
6508  __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
6509  if (__pyx_t_2) {
6510  } else {
6511  __pyx_t_1 = __pyx_t_2;
6512  goto __pyx_L7_bool_binop_done;
6513  }
6514 
6515  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":275
6516  *
6517  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
6518  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
6519  * raise ValueError(u"ndarray is not Fortran contiguous")
6520  *
6521  */
6522  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_F_CONTIGUOUS) != 0)) != 0);
6523  __pyx_t_1 = __pyx_t_2;
6524  __pyx_L7_bool_binop_done:;
6525 
6526  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
6527  * raise ValueError(u"ndarray is not C contiguous")
6528  *
6529  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
6530  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
6531  * raise ValueError(u"ndarray is not Fortran contiguous")
6532  */
6533  if (unlikely(__pyx_t_1)) {
6534 
6535  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
6536  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
6537  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
6538  * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
6539  *
6540  * info.buf = PyArray_DATA(self)
6541  */
6542  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 276, __pyx_L1_error)
6543  __Pyx_GOTREF(__pyx_t_3);
6544  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6545  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6546  __PYX_ERR(3, 276, __pyx_L1_error)
6547 
6548  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
6549  * raise ValueError(u"ndarray is not C contiguous")
6550  *
6551  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
6552  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
6553  * raise ValueError(u"ndarray is not Fortran contiguous")
6554  */
6555  }
6556 
6557  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":278
6558  * raise ValueError(u"ndarray is not Fortran contiguous")
6559  *
6560  * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
6561  * info.ndim = ndim
6562  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
6563  */
6564  __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
6565 
6566  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":279
6567  *
6568  * info.buf = PyArray_DATA(self)
6569  * info.ndim = ndim # <<<<<<<<<<<<<<
6570  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
6571  * # Allocate new buffer for strides and shape info.
6572  */
6573  __pyx_v_info->ndim = __pyx_v_ndim;
6574 
6575  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
6576  * info.buf = PyArray_DATA(self)
6577  * info.ndim = ndim
6578  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
6579  * # Allocate new buffer for strides and shape info.
6580  * # This is allocated as one block, strides first.
6581  */
6582  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
6583  if (__pyx_t_1) {
6584 
6585  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":283
6586  * # Allocate new buffer for strides and shape info.
6587  * # This is allocated as one block, strides first.
6588  * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim) # <<<<<<<<<<<<<<
6589  * info.shape = info.strides + ndim
6590  * for i in range(ndim):
6591  */
6592  __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
6593 
6594  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":284
6595  * # This is allocated as one block, strides first.
6596  * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
6597  * info.shape = info.strides + ndim # <<<<<<<<<<<<<<
6598  * for i in range(ndim):
6599  * info.strides[i] = PyArray_STRIDES(self)[i]
6600  */
6601  __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
6602 
6603  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":285
6604  * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
6605  * info.shape = info.strides + ndim
6606  * for i in range(ndim): # <<<<<<<<<<<<<<
6607  * info.strides[i] = PyArray_STRIDES(self)[i]
6608  * info.shape[i] = PyArray_DIMS(self)[i]
6609  */
6610  __pyx_t_4 = __pyx_v_ndim;
6611  __pyx_t_5 = __pyx_t_4;
6612  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
6613  __pyx_v_i = __pyx_t_6;
6614 
6615  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":286
6616  * info.shape = info.strides + ndim
6617  * for i in range(ndim):
6618  * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
6619  * info.shape[i] = PyArray_DIMS(self)[i]
6620  * else:
6621  */
6622  (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
6623 
6624  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":287
6625  * for i in range(ndim):
6626  * info.strides[i] = PyArray_STRIDES(self)[i]
6627  * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
6628  * else:
6629  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
6630  */
6631  (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
6632  }
6633 
6634  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
6635  * info.buf = PyArray_DATA(self)
6636  * info.ndim = ndim
6637  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
6638  * # Allocate new buffer for strides and shape info.
6639  * # This is allocated as one block, strides first.
6640  */
6641  goto __pyx_L9;
6642  }
6643 
6644  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":289
6645  * info.shape[i] = PyArray_DIMS(self)[i]
6646  * else:
6647  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
6648  * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
6649  * info.suboffsets = NULL
6650  */
6651  /*else*/ {
6652  __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
6653 
6654  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":290
6655  * else:
6656  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
6657  * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
6658  * info.suboffsets = NULL
6659  * info.itemsize = PyArray_ITEMSIZE(self)
6660  */
6661  __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
6662  }
6663  __pyx_L9:;
6664 
6665  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":291
6666  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
6667  * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
6668  * info.suboffsets = NULL # <<<<<<<<<<<<<<
6669  * info.itemsize = PyArray_ITEMSIZE(self)
6670  * info.readonly = not PyArray_ISWRITEABLE(self)
6671  */
6672  __pyx_v_info->suboffsets = NULL;
6673 
6674  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":292
6675  * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
6676  * info.suboffsets = NULL
6677  * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
6678  * info.readonly = not PyArray_ISWRITEABLE(self)
6679  *
6680  */
6681  __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
6682 
6683  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":293
6684  * info.suboffsets = NULL
6685  * info.itemsize = PyArray_ITEMSIZE(self)
6686  * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
6687  *
6688  * cdef int t
6689  */
6690  __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
6691 
6692  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":296
6693  *
6694  * cdef int t
6695  * cdef char* f = NULL # <<<<<<<<<<<<<<
6696  * cdef dtype descr = <dtype>PyArray_DESCR(self)
6697  * cdef int offset
6698  */
6699  __pyx_v_f = NULL;
6700 
6701  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":297
6702  * cdef int t
6703  * cdef char* f = NULL
6704  * cdef dtype descr = <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
6705  * cdef int offset
6706  *
6707  */
6708  __pyx_t_7 = PyArray_DESCR(__pyx_v_self);
6709  __pyx_t_3 = ((PyObject *)__pyx_t_7);
6710  __Pyx_INCREF(__pyx_t_3);
6711  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
6712  __pyx_t_3 = 0;
6713 
6714  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":300
6715  * cdef int offset
6716  *
6717  * info.obj = self # <<<<<<<<<<<<<<
6718  *
6719  * if not PyDataType_HASFIELDS(descr):
6720  */
6721  __Pyx_INCREF(((PyObject *)__pyx_v_self));
6722  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
6723  __Pyx_GOTREF(__pyx_v_info->obj);
6724  __Pyx_DECREF(__pyx_v_info->obj);
6725  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
6726 
6727  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":302
6728  * info.obj = self
6729  *
6730  * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
6731  * t = descr.type_num
6732  * if ((descr.byteorder == c'>' and little_endian) or
6733  */
6734  __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
6735  if (__pyx_t_1) {
6736 
6737  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":303
6738  *
6739  * if not PyDataType_HASFIELDS(descr):
6740  * t = descr.type_num # <<<<<<<<<<<<<<
6741  * if ((descr.byteorder == c'>' and little_endian) or
6742  * (descr.byteorder == c'<' and not little_endian)):
6743  */
6744  __pyx_t_4 = __pyx_v_descr->type_num;
6745  __pyx_v_t = __pyx_t_4;
6746 
6747  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":304
6748  * if not PyDataType_HASFIELDS(descr):
6749  * t = descr.type_num
6750  * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
6751  * (descr.byteorder == c'<' and not little_endian)):
6752  * raise ValueError(u"Non-native byte order not supported")
6753  */
6754  __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
6755  if (!__pyx_t_2) {
6756  goto __pyx_L15_next_or;
6757  } else {
6758  }
6759  __pyx_t_2 = (__pyx_v_little_endian != 0);
6760  if (!__pyx_t_2) {
6761  } else {
6762  __pyx_t_1 = __pyx_t_2;
6763  goto __pyx_L14_bool_binop_done;
6764  }
6765  __pyx_L15_next_or:;
6766 
6767  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":305
6768  * t = descr.type_num
6769  * if ((descr.byteorder == c'>' and little_endian) or
6770  * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
6771  * raise ValueError(u"Non-native byte order not supported")
6772  * if t == NPY_BYTE: f = "b"
6773  */
6774  __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
6775  if (__pyx_t_2) {
6776  } else {
6777  __pyx_t_1 = __pyx_t_2;
6778  goto __pyx_L14_bool_binop_done;
6779  }
6780  __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
6781  __pyx_t_1 = __pyx_t_2;
6782  __pyx_L14_bool_binop_done:;
6783 
6784  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":304
6785  * if not PyDataType_HASFIELDS(descr):
6786  * t = descr.type_num
6787  * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
6788  * (descr.byteorder == c'<' and not little_endian)):
6789  * raise ValueError(u"Non-native byte order not supported")
6790  */
6791  if (unlikely(__pyx_t_1)) {
6792 
6793  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":306
6794  * if ((descr.byteorder == c'>' and little_endian) or
6795  * (descr.byteorder == c'<' and not little_endian)):
6796  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
6797  * if t == NPY_BYTE: f = "b"
6798  * elif t == NPY_UBYTE: f = "B"
6799  */
6800  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 306, __pyx_L1_error)
6801  __Pyx_GOTREF(__pyx_t_3);
6802  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6803  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6804  __PYX_ERR(3, 306, __pyx_L1_error)
6805 
6806  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":304
6807  * if not PyDataType_HASFIELDS(descr):
6808  * t = descr.type_num
6809  * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
6810  * (descr.byteorder == c'<' and not little_endian)):
6811  * raise ValueError(u"Non-native byte order not supported")
6812  */
6813  }
6814 
6815  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":307
6816  * (descr.byteorder == c'<' and not little_endian)):
6817  * raise ValueError(u"Non-native byte order not supported")
6818  * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
6819  * elif t == NPY_UBYTE: f = "B"
6820  * elif t == NPY_SHORT: f = "h"
6821  */
6822  switch (__pyx_v_t) {
6823  case NPY_BYTE:
6824  __pyx_v_f = ((char *)"b");
6825  break;
6826  case NPY_UBYTE:
6827 
6828  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":308
6829  * raise ValueError(u"Non-native byte order not supported")
6830  * if t == NPY_BYTE: f = "b"
6831  * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
6832  * elif t == NPY_SHORT: f = "h"
6833  * elif t == NPY_USHORT: f = "H"
6834  */
6835  __pyx_v_f = ((char *)"B");
6836  break;
6837  case NPY_SHORT:
6838 
6839  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":309
6840  * if t == NPY_BYTE: f = "b"
6841  * elif t == NPY_UBYTE: f = "B"
6842  * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
6843  * elif t == NPY_USHORT: f = "H"
6844  * elif t == NPY_INT: f = "i"
6845  */
6846  __pyx_v_f = ((char *)"h");
6847  break;
6848  case NPY_USHORT:
6849 
6850  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":310
6851  * elif t == NPY_UBYTE: f = "B"
6852  * elif t == NPY_SHORT: f = "h"
6853  * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
6854  * elif t == NPY_INT: f = "i"
6855  * elif t == NPY_UINT: f = "I"
6856  */
6857  __pyx_v_f = ((char *)"H");
6858  break;
6859  case NPY_INT:
6860 
6861  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":311
6862  * elif t == NPY_SHORT: f = "h"
6863  * elif t == NPY_USHORT: f = "H"
6864  * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
6865  * elif t == NPY_UINT: f = "I"
6866  * elif t == NPY_LONG: f = "l"
6867  */
6868  __pyx_v_f = ((char *)"i");
6869  break;
6870  case NPY_UINT:
6871 
6872  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":312
6873  * elif t == NPY_USHORT: f = "H"
6874  * elif t == NPY_INT: f = "i"
6875  * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
6876  * elif t == NPY_LONG: f = "l"
6877  * elif t == NPY_ULONG: f = "L"
6878  */
6879  __pyx_v_f = ((char *)"I");
6880  break;
6881  case NPY_LONG:
6882 
6883  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":313
6884  * elif t == NPY_INT: f = "i"
6885  * elif t == NPY_UINT: f = "I"
6886  * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
6887  * elif t == NPY_ULONG: f = "L"
6888  * elif t == NPY_LONGLONG: f = "q"
6889  */
6890  __pyx_v_f = ((char *)"l");
6891  break;
6892  case NPY_ULONG:
6893 
6894  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":314
6895  * elif t == NPY_UINT: f = "I"
6896  * elif t == NPY_LONG: f = "l"
6897  * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
6898  * elif t == NPY_LONGLONG: f = "q"
6899  * elif t == NPY_ULONGLONG: f = "Q"
6900  */
6901  __pyx_v_f = ((char *)"L");
6902  break;
6903  case NPY_LONGLONG:
6904 
6905  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":315
6906  * elif t == NPY_LONG: f = "l"
6907  * elif t == NPY_ULONG: f = "L"
6908  * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
6909  * elif t == NPY_ULONGLONG: f = "Q"
6910  * elif t == NPY_FLOAT: f = "f"
6911  */
6912  __pyx_v_f = ((char *)"q");
6913  break;
6914  case NPY_ULONGLONG:
6915 
6916  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":316
6917  * elif t == NPY_ULONG: f = "L"
6918  * elif t == NPY_LONGLONG: f = "q"
6919  * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
6920  * elif t == NPY_FLOAT: f = "f"
6921  * elif t == NPY_DOUBLE: f = "d"
6922  */
6923  __pyx_v_f = ((char *)"Q");
6924  break;
6925  case NPY_FLOAT:
6926 
6927  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":317
6928  * elif t == NPY_LONGLONG: f = "q"
6929  * elif t == NPY_ULONGLONG: f = "Q"
6930  * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
6931  * elif t == NPY_DOUBLE: f = "d"
6932  * elif t == NPY_LONGDOUBLE: f = "g"
6933  */
6934  __pyx_v_f = ((char *)"f");
6935  break;
6936  case NPY_DOUBLE:
6937 
6938  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":318
6939  * elif t == NPY_ULONGLONG: f = "Q"
6940  * elif t == NPY_FLOAT: f = "f"
6941  * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
6942  * elif t == NPY_LONGDOUBLE: f = "g"
6943  * elif t == NPY_CFLOAT: f = "Zf"
6944  */
6945  __pyx_v_f = ((char *)"d");
6946  break;
6947  case NPY_LONGDOUBLE:
6948 
6949  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":319
6950  * elif t == NPY_FLOAT: f = "f"
6951  * elif t == NPY_DOUBLE: f = "d"
6952  * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
6953  * elif t == NPY_CFLOAT: f = "Zf"
6954  * elif t == NPY_CDOUBLE: f = "Zd"
6955  */
6956  __pyx_v_f = ((char *)"g");
6957  break;
6958  case NPY_CFLOAT:
6959 
6960  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":320
6961  * elif t == NPY_DOUBLE: f = "d"
6962  * elif t == NPY_LONGDOUBLE: f = "g"
6963  * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
6964  * elif t == NPY_CDOUBLE: f = "Zd"
6965  * elif t == NPY_CLONGDOUBLE: f = "Zg"
6966  */
6967  __pyx_v_f = ((char *)"Zf");
6968  break;
6969  case NPY_CDOUBLE:
6970 
6971  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":321
6972  * elif t == NPY_LONGDOUBLE: f = "g"
6973  * elif t == NPY_CFLOAT: f = "Zf"
6974  * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
6975  * elif t == NPY_CLONGDOUBLE: f = "Zg"
6976  * elif t == NPY_OBJECT: f = "O"
6977  */
6978  __pyx_v_f = ((char *)"Zd");
6979  break;
6980  case NPY_CLONGDOUBLE:
6981 
6982  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":322
6983  * elif t == NPY_CFLOAT: f = "Zf"
6984  * elif t == NPY_CDOUBLE: f = "Zd"
6985  * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
6986  * elif t == NPY_OBJECT: f = "O"
6987  * else:
6988  */
6989  __pyx_v_f = ((char *)"Zg");
6990  break;
6991  case NPY_OBJECT:
6992 
6993  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":323
6994  * elif t == NPY_CDOUBLE: f = "Zd"
6995  * elif t == NPY_CLONGDOUBLE: f = "Zg"
6996  * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
6997  * else:
6998  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
6999  */
7000  __pyx_v_f = ((char *)"O");
7001  break;
7002  default:
7003 
7004  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":325
7005  * elif t == NPY_OBJECT: f = "O"
7006  * else:
7007  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
7008  * info.format = f
7009  * return
7010  */
7011  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 325, __pyx_L1_error)
7012  __Pyx_GOTREF(__pyx_t_3);
7013  __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 325, __pyx_L1_error)
7014  __Pyx_GOTREF(__pyx_t_8);
7015  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7016  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 325, __pyx_L1_error)
7017  __Pyx_GOTREF(__pyx_t_3);
7018  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7019  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7020  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7021  __PYX_ERR(3, 325, __pyx_L1_error)
7022  break;
7023  }
7024 
7025  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":326
7026  * else:
7027  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7028  * info.format = f # <<<<<<<<<<<<<<
7029  * return
7030  * else:
7031  */
7032  __pyx_v_info->format = __pyx_v_f;
7033 
7034  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":327
7035  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7036  * info.format = f
7037  * return # <<<<<<<<<<<<<<
7038  * else:
7039  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
7040  */
7041  __pyx_r = 0;
7042  goto __pyx_L0;
7043 
7044  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":302
7045  * info.obj = self
7046  *
7047  * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
7048  * t = descr.type_num
7049  * if ((descr.byteorder == c'>' and little_endian) or
7050  */
7051  }
7052 
7053  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":329
7054  * return
7055  * else:
7056  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
7057  * info.format[0] = c'^' # Native data types, manual alignment
7058  * offset = 0
7059  */
7060  /*else*/ {
7061  __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF));
7062 
7063  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":330
7064  * else:
7065  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
7066  * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
7067  * offset = 0
7068  * f = _util_dtypestring(descr, info.format + 1,
7069  */
7070  (__pyx_v_info->format[0]) = '^';
7071 
7072  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":331
7073  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
7074  * info.format[0] = c'^' # Native data types, manual alignment
7075  * offset = 0 # <<<<<<<<<<<<<<
7076  * f = _util_dtypestring(descr, info.format + 1,
7077  * info.format + _buffer_format_string_len,
7078  */
7079  __pyx_v_offset = 0;
7080 
7081  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":332
7082  * info.format[0] = c'^' # Native data types, manual alignment
7083  * offset = 0
7084  * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<<
7085  * info.format + _buffer_format_string_len,
7086  * &offset)
7087  */
7088  __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(3, 332, __pyx_L1_error)
7089  __pyx_v_f = __pyx_t_9;
7090 
7091  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":335
7092  * info.format + _buffer_format_string_len,
7093  * &offset)
7094  * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
7095  *
7096  * def __releasebuffer__(ndarray self, Py_buffer* info):
7097  */
7098  (__pyx_v_f[0]) = '\x00';
7099  }
7100 
7101  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":258
7102  * # experimental exception made for __getbuffer__ and __releasebuffer__
7103  * # -- the details of this may change.
7104  * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
7105  * # This implementation of getbuffer is geared towards Cython
7106  * # requirements, and does not yet fulfill the PEP.
7107  */
7108 
7109  /* function exit code */
7110  __pyx_r = 0;
7111  goto __pyx_L0;
7112  __pyx_L1_error:;
7113  __Pyx_XDECREF(__pyx_t_3);
7114  __Pyx_XDECREF(__pyx_t_8);
7115  __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7116  __pyx_r = -1;
7117  if (__pyx_v_info->obj != NULL) {
7118  __Pyx_GOTREF(__pyx_v_info->obj);
7119  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7120  }
7121  goto __pyx_L2;
7122  __pyx_L0:;
7123  if (__pyx_v_info->obj == Py_None) {
7124  __Pyx_GOTREF(__pyx_v_info->obj);
7125  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7126  }
7127  __pyx_L2:;
7128  __Pyx_XDECREF((PyObject *)__pyx_v_descr);
7129  __Pyx_TraceReturn(Py_None, 0);
7130  __Pyx_RefNannyFinishContext();
7131  return __pyx_r;
7132 }
7133 
7134 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":337
7135  * f[0] = c'\0' # Terminate format string
7136  *
7137  * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
7138  * if PyArray_HASFIELDS(self):
7139  * PyObject_Free(info.format)
7140  */
7141 
7142 /* Python wrapper */
7143 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
7144 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
7145  __Pyx_RefNannyDeclarations
7146  __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
7147  __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
7148 
7149  /* function exit code */
7150  __Pyx_RefNannyFinishContext();
7151 }
7152 
7153 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
7154  __Pyx_TraceDeclarations
7155  __Pyx_RefNannyDeclarations
7156  int __pyx_t_1;
7157  __Pyx_RefNannySetupContext("__releasebuffer__", 0);
7158  __Pyx_TraceCall("__releasebuffer__", __pyx_f[3], 337, 0, __PYX_ERR(3, 337, __pyx_L1_error));
7159 
7160  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":338
7161  *
7162  * def __releasebuffer__(ndarray self, Py_buffer* info):
7163  * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
7164  * PyObject_Free(info.format)
7165  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
7166  */
7167  __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
7168  if (__pyx_t_1) {
7169 
7170  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":339
7171  * def __releasebuffer__(ndarray self, Py_buffer* info):
7172  * if PyArray_HASFIELDS(self):
7173  * PyObject_Free(info.format) # <<<<<<<<<<<<<<
7174  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
7175  * PyObject_Free(info.strides)
7176  */
7177  PyObject_Free(__pyx_v_info->format);
7178 
7179  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":338
7180  *
7181  * def __releasebuffer__(ndarray self, Py_buffer* info):
7182  * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
7183  * PyObject_Free(info.format)
7184  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
7185  */
7186  }
7187 
7188  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":340
7189  * if PyArray_HASFIELDS(self):
7190  * PyObject_Free(info.format)
7191  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
7192  * PyObject_Free(info.strides)
7193  * # info.shape was stored after info.strides in the same block
7194  */
7195  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
7196  if (__pyx_t_1) {
7197 
7198  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":341
7199  * PyObject_Free(info.format)
7200  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
7201  * PyObject_Free(info.strides) # <<<<<<<<<<<<<<
7202  * # info.shape was stored after info.strides in the same block
7203  *
7204  */
7205  PyObject_Free(__pyx_v_info->strides);
7206 
7207  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":340
7208  * if PyArray_HASFIELDS(self):
7209  * PyObject_Free(info.format)
7210  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
7211  * PyObject_Free(info.strides)
7212  * # info.shape was stored after info.strides in the same block
7213  */
7214  }
7215 
7216  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":337
7217  * f[0] = c'\0' # Terminate format string
7218  *
7219  * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
7220  * if PyArray_HASFIELDS(self):
7221  * PyObject_Free(info.format)
7222  */
7223 
7224  /* function exit code */
7225  goto __pyx_L0;
7226  __pyx_L1_error:;
7227  __Pyx_WriteUnraisable("numpy.ndarray.__releasebuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
7228  __pyx_L0:;
7229  __Pyx_TraceReturn(Py_None, 0);
7230  __Pyx_RefNannyFinishContext();
7231 }
7232 
7233 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":821
7234  * ctypedef npy_cdouble complex_t
7235  *
7236  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
7237  * return PyArray_MultiIterNew(1, <void*>a)
7238  *
7239  */
7240 
7241 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
7242  PyObject *__pyx_r = NULL;
7243  __Pyx_TraceDeclarations
7244  __Pyx_RefNannyDeclarations
7245  PyObject *__pyx_t_1 = NULL;
7246  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
7247  __Pyx_TraceCall("PyArray_MultiIterNew1", __pyx_f[3], 821, 0, __PYX_ERR(3, 821, __pyx_L1_error));
7248 
7249  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":822
7250  *
7251  * cdef inline object PyArray_MultiIterNew1(a):
7252  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
7253  *
7254  * cdef inline object PyArray_MultiIterNew2(a, b):
7255  */
7256  __Pyx_XDECREF(__pyx_r);
7257  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 822, __pyx_L1_error)
7258  __Pyx_GOTREF(__pyx_t_1);
7259  __pyx_r = __pyx_t_1;
7260  __pyx_t_1 = 0;
7261  goto __pyx_L0;
7262 
7263  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":821
7264  * ctypedef npy_cdouble complex_t
7265  *
7266  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
7267  * return PyArray_MultiIterNew(1, <void*>a)
7268  *
7269  */
7270 
7271  /* function exit code */
7272  __pyx_L1_error:;
7273  __Pyx_XDECREF(__pyx_t_1);
7274  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
7275  __pyx_r = 0;
7276  __pyx_L0:;
7277  __Pyx_XGIVEREF(__pyx_r);
7278  __Pyx_TraceReturn(__pyx_r, 0);
7279  __Pyx_RefNannyFinishContext();
7280  return __pyx_r;
7281 }
7282 
7283 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":824
7284  * return PyArray_MultiIterNew(1, <void*>a)
7285  *
7286  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
7287  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7288  *
7289  */
7290 
7291 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
7292  PyObject *__pyx_r = NULL;
7293  __Pyx_TraceDeclarations
7294  __Pyx_RefNannyDeclarations
7295  PyObject *__pyx_t_1 = NULL;
7296  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
7297  __Pyx_TraceCall("PyArray_MultiIterNew2", __pyx_f[3], 824, 0, __PYX_ERR(3, 824, __pyx_L1_error));
7298 
7299  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":825
7300  *
7301  * cdef inline object PyArray_MultiIterNew2(a, b):
7302  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
7303  *
7304  * cdef inline object PyArray_MultiIterNew3(a, b, c):
7305  */
7306  __Pyx_XDECREF(__pyx_r);
7307  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 825, __pyx_L1_error)
7308  __Pyx_GOTREF(__pyx_t_1);
7309  __pyx_r = __pyx_t_1;
7310  __pyx_t_1 = 0;
7311  goto __pyx_L0;
7312 
7313  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":824
7314  * return PyArray_MultiIterNew(1, <void*>a)
7315  *
7316  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
7317  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7318  *
7319  */
7320 
7321  /* function exit code */
7322  __pyx_L1_error:;
7323  __Pyx_XDECREF(__pyx_t_1);
7324  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
7325  __pyx_r = 0;
7326  __pyx_L0:;
7327  __Pyx_XGIVEREF(__pyx_r);
7328  __Pyx_TraceReturn(__pyx_r, 0);
7329  __Pyx_RefNannyFinishContext();
7330  return __pyx_r;
7331 }
7332 
7333 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":827
7334  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7335  *
7336  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
7337  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7338  *
7339  */
7340 
7341 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
7342  PyObject *__pyx_r = NULL;
7343  __Pyx_TraceDeclarations
7344  __Pyx_RefNannyDeclarations
7345  PyObject *__pyx_t_1 = NULL;
7346  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
7347  __Pyx_TraceCall("PyArray_MultiIterNew3", __pyx_f[3], 827, 0, __PYX_ERR(3, 827, __pyx_L1_error));
7348 
7349  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":828
7350  *
7351  * cdef inline object PyArray_MultiIterNew3(a, b, c):
7352  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
7353  *
7354  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
7355  */
7356  __Pyx_XDECREF(__pyx_r);
7357  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 828, __pyx_L1_error)
7358  __Pyx_GOTREF(__pyx_t_1);
7359  __pyx_r = __pyx_t_1;
7360  __pyx_t_1 = 0;
7361  goto __pyx_L0;
7362 
7363  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":827
7364  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7365  *
7366  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
7367  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7368  *
7369  */
7370 
7371  /* function exit code */
7372  __pyx_L1_error:;
7373  __Pyx_XDECREF(__pyx_t_1);
7374  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
7375  __pyx_r = 0;
7376  __pyx_L0:;
7377  __Pyx_XGIVEREF(__pyx_r);
7378  __Pyx_TraceReturn(__pyx_r, 0);
7379  __Pyx_RefNannyFinishContext();
7380  return __pyx_r;
7381 }
7382 
7383 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":830
7384  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7385  *
7386  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
7387  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7388  *
7389  */
7390 
7391 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
7392  PyObject *__pyx_r = NULL;
7393  __Pyx_TraceDeclarations
7394  __Pyx_RefNannyDeclarations
7395  PyObject *__pyx_t_1 = NULL;
7396  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
7397  __Pyx_TraceCall("PyArray_MultiIterNew4", __pyx_f[3], 830, 0, __PYX_ERR(3, 830, __pyx_L1_error));
7398 
7399  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":831
7400  *
7401  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
7402  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
7403  *
7404  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
7405  */
7406  __Pyx_XDECREF(__pyx_r);
7407  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 831, __pyx_L1_error)
7408  __Pyx_GOTREF(__pyx_t_1);
7409  __pyx_r = __pyx_t_1;
7410  __pyx_t_1 = 0;
7411  goto __pyx_L0;
7412 
7413  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":830
7414  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7415  *
7416  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
7417  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7418  *
7419  */
7420 
7421  /* function exit code */
7422  __pyx_L1_error:;
7423  __Pyx_XDECREF(__pyx_t_1);
7424  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
7425  __pyx_r = 0;
7426  __pyx_L0:;
7427  __Pyx_XGIVEREF(__pyx_r);
7428  __Pyx_TraceReturn(__pyx_r, 0);
7429  __Pyx_RefNannyFinishContext();
7430  return __pyx_r;
7431 }
7432 
7433 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
7434  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7435  *
7436  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
7437  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7438  *
7439  */
7440 
7441 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
7442  PyObject *__pyx_r = NULL;
7443  __Pyx_TraceDeclarations
7444  __Pyx_RefNannyDeclarations
7445  PyObject *__pyx_t_1 = NULL;
7446  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
7447  __Pyx_TraceCall("PyArray_MultiIterNew5", __pyx_f[3], 833, 0, __PYX_ERR(3, 833, __pyx_L1_error));
7448 
7449  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":834
7450  *
7451  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
7452  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
7453  *
7454  * cdef inline tuple PyDataType_SHAPE(dtype d):
7455  */
7456  __Pyx_XDECREF(__pyx_r);
7457  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 834, __pyx_L1_error)
7458  __Pyx_GOTREF(__pyx_t_1);
7459  __pyx_r = __pyx_t_1;
7460  __pyx_t_1 = 0;
7461  goto __pyx_L0;
7462 
7463  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
7464  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7465  *
7466  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
7467  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7468  *
7469  */
7470 
7471  /* function exit code */
7472  __pyx_L1_error:;
7473  __Pyx_XDECREF(__pyx_t_1);
7474  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
7475  __pyx_r = 0;
7476  __pyx_L0:;
7477  __Pyx_XGIVEREF(__pyx_r);
7478  __Pyx_TraceReturn(__pyx_r, 0);
7479  __Pyx_RefNannyFinishContext();
7480  return __pyx_r;
7481 }
7482 
7483 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":836
7484  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7485  *
7486  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
7487  * if PyDataType_HASSUBARRAY(d):
7488  * return <tuple>d.subarray.shape
7489  */
7490 
7491 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
7492  PyObject *__pyx_r = NULL;
7493  __Pyx_TraceDeclarations
7494  __Pyx_RefNannyDeclarations
7495  int __pyx_t_1;
7496  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
7497  __Pyx_TraceCall("PyDataType_SHAPE", __pyx_f[3], 836, 0, __PYX_ERR(3, 836, __pyx_L1_error));
7498 
7499  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":837
7500  *
7501  * cdef inline tuple PyDataType_SHAPE(dtype d):
7502  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
7503  * return <tuple>d.subarray.shape
7504  * else:
7505  */
7506  __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
7507  if (__pyx_t_1) {
7508 
7509  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":838
7510  * cdef inline tuple PyDataType_SHAPE(dtype d):
7511  * if PyDataType_HASSUBARRAY(d):
7512  * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
7513  * else:
7514  * return ()
7515  */
7516  __Pyx_XDECREF(__pyx_r);
7517  __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
7518  __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
7519  goto __pyx_L0;
7520 
7521  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":837
7522  *
7523  * cdef inline tuple PyDataType_SHAPE(dtype d):
7524  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
7525  * return <tuple>d.subarray.shape
7526  * else:
7527  */
7528  }
7529 
7530  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":840
7531  * return <tuple>d.subarray.shape
7532  * else:
7533  * return () # <<<<<<<<<<<<<<
7534  *
7535  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
7536  */
7537  /*else*/ {
7538  __Pyx_XDECREF(__pyx_r);
7539  __Pyx_INCREF(__pyx_empty_tuple);
7540  __pyx_r = __pyx_empty_tuple;
7541  goto __pyx_L0;
7542  }
7543 
7544  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":836
7545  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7546  *
7547  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
7548  * if PyDataType_HASSUBARRAY(d):
7549  * return <tuple>d.subarray.shape
7550  */
7551 
7552  /* function exit code */
7553  __pyx_L1_error:;
7554  __Pyx_AddTraceback("numpy.PyDataType_SHAPE", __pyx_clineno, __pyx_lineno, __pyx_filename);
7555  __pyx_r = 0;
7556  __pyx_L0:;
7557  __Pyx_XGIVEREF(__pyx_r);
7558  __Pyx_TraceReturn(__pyx_r, 0);
7559  __Pyx_RefNannyFinishContext();
7560  return __pyx_r;
7561 }
7562 
7563 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":842
7564  * return ()
7565  *
7566  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
7567  * # Recursive utility function used in __getbuffer__ to get format
7568  * # string. The new location in the format string is returned.
7569  */
7570 
7571 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
7572  PyArray_Descr *__pyx_v_child = 0;
7573  int __pyx_v_endian_detector;
7574  int __pyx_v_little_endian;
7575  PyObject *__pyx_v_fields = 0;
7576  PyObject *__pyx_v_childname = NULL;
7577  PyObject *__pyx_v_new_offset = NULL;
7578  PyObject *__pyx_v_t = NULL;
7579  char *__pyx_r;
7580  __Pyx_TraceDeclarations
7581  __Pyx_RefNannyDeclarations
7582  PyObject *__pyx_t_1 = NULL;
7583  Py_ssize_t __pyx_t_2;
7584  PyObject *__pyx_t_3 = NULL;
7585  PyObject *__pyx_t_4 = NULL;
7586  int __pyx_t_5;
7587  int __pyx_t_6;
7588  int __pyx_t_7;
7589  long __pyx_t_8;
7590  char *__pyx_t_9;
7591  __Pyx_RefNannySetupContext("_util_dtypestring", 0);
7592  __Pyx_TraceCall("_util_dtypestring", __pyx_f[3], 842, 0, __PYX_ERR(3, 842, __pyx_L1_error));
7593 
7594  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":847
7595  *
7596  * cdef dtype child
7597  * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
7598  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
7599  * cdef tuple fields
7600  */
7601  __pyx_v_endian_detector = 1;
7602 
7603  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":848
7604  * cdef dtype child
7605  * cdef int endian_detector = 1
7606  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
7607  * cdef tuple fields
7608  *
7609  */
7610  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
7611 
7612  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":851
7613  * cdef tuple fields
7614  *
7615  * for childname in descr.names: # <<<<<<<<<<<<<<
7616  * fields = descr.fields[childname]
7617  * child, new_offset = fields
7618  */
7619  if (unlikely(__pyx_v_descr->names == Py_None)) {
7620  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
7621  __PYX_ERR(3, 851, __pyx_L1_error)
7622  }
7623  __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
7624  for (;;) {
7625  if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
7626  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7627  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 851, __pyx_L1_error)
7628  #else
7629  __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 851, __pyx_L1_error)
7630  __Pyx_GOTREF(__pyx_t_3);
7631  #endif
7632  __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
7633  __pyx_t_3 = 0;
7634 
7635  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":852
7636  *
7637  * for childname in descr.names:
7638  * fields = descr.fields[childname] # <<<<<<<<<<<<<<
7639  * child, new_offset = fields
7640  *
7641  */
7642  if (unlikely(__pyx_v_descr->fields == Py_None)) {
7643  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
7644  __PYX_ERR(3, 852, __pyx_L1_error)
7645  }
7646  __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 852, __pyx_L1_error)
7647  __Pyx_GOTREF(__pyx_t_3);
7648  if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(3, 852, __pyx_L1_error)
7649  __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
7650  __pyx_t_3 = 0;
7651 
7652  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":853
7653  * for childname in descr.names:
7654  * fields = descr.fields[childname]
7655  * child, new_offset = fields # <<<<<<<<<<<<<<
7656  *
7657  * if (end - f) - <int>(new_offset - offset[0]) < 15:
7658  */
7659  if (likely(__pyx_v_fields != Py_None)) {
7660  PyObject* sequence = __pyx_v_fields;
7661  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
7662  if (unlikely(size != 2)) {
7663  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
7664  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
7665  __PYX_ERR(3, 853, __pyx_L1_error)
7666  }
7667  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7668  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
7669  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
7670  __Pyx_INCREF(__pyx_t_3);
7671  __Pyx_INCREF(__pyx_t_4);
7672  #else
7673  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 853, __pyx_L1_error)
7674  __Pyx_GOTREF(__pyx_t_3);
7675  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 853, __pyx_L1_error)
7676  __Pyx_GOTREF(__pyx_t_4);
7677  #endif
7678  } else {
7679  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 853, __pyx_L1_error)
7680  }
7681  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(3, 853, __pyx_L1_error)
7682  __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
7683  __pyx_t_3 = 0;
7684  __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
7685  __pyx_t_4 = 0;
7686 
7687  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":855
7688  * child, new_offset = fields
7689  *
7690  * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
7691  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7692  *
7693  */
7694  __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 855, __pyx_L1_error)
7695  __Pyx_GOTREF(__pyx_t_4);
7696  __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 855, __pyx_L1_error)
7697  __Pyx_GOTREF(__pyx_t_3);
7698  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7699  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 855, __pyx_L1_error)
7700  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7701  __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
7702  if (unlikely(__pyx_t_6)) {
7703 
7704  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":856
7705  *
7706  * if (end - f) - <int>(new_offset - offset[0]) < 15:
7707  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
7708  *
7709  * if ((child.byteorder == c'>' and little_endian) or
7710  */
7711  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 856, __pyx_L1_error)
7712  __Pyx_GOTREF(__pyx_t_3);
7713  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7714  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7715  __PYX_ERR(3, 856, __pyx_L1_error)
7716 
7717  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":855
7718  * child, new_offset = fields
7719  *
7720  * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
7721  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7722  *
7723  */
7724  }
7725 
7726  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":858
7727  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7728  *
7729  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
7730  * (child.byteorder == c'<' and not little_endian)):
7731  * raise ValueError(u"Non-native byte order not supported")
7732  */
7733  __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
7734  if (!__pyx_t_7) {
7735  goto __pyx_L8_next_or;
7736  } else {
7737  }
7738  __pyx_t_7 = (__pyx_v_little_endian != 0);
7739  if (!__pyx_t_7) {
7740  } else {
7741  __pyx_t_6 = __pyx_t_7;
7742  goto __pyx_L7_bool_binop_done;
7743  }
7744  __pyx_L8_next_or:;
7745 
7746  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":859
7747  *
7748  * if ((child.byteorder == c'>' and little_endian) or
7749  * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
7750  * raise ValueError(u"Non-native byte order not supported")
7751  * # One could encode it in the format string and have Cython
7752  */
7753  __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
7754  if (__pyx_t_7) {
7755  } else {
7756  __pyx_t_6 = __pyx_t_7;
7757  goto __pyx_L7_bool_binop_done;
7758  }
7759  __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
7760  __pyx_t_6 = __pyx_t_7;
7761  __pyx_L7_bool_binop_done:;
7762 
7763  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":858
7764  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7765  *
7766  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
7767  * (child.byteorder == c'<' and not little_endian)):
7768  * raise ValueError(u"Non-native byte order not supported")
7769  */
7770  if (unlikely(__pyx_t_6)) {
7771 
7772  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":860
7773  * if ((child.byteorder == c'>' and little_endian) or
7774  * (child.byteorder == c'<' and not little_endian)):
7775  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
7776  * # One could encode it in the format string and have Cython
7777  * # complain instead, BUT: < and > in format strings also imply
7778  */
7779  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 860, __pyx_L1_error)
7780  __Pyx_GOTREF(__pyx_t_3);
7781  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7782  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7783  __PYX_ERR(3, 860, __pyx_L1_error)
7784 
7785  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":858
7786  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7787  *
7788  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
7789  * (child.byteorder == c'<' and not little_endian)):
7790  * raise ValueError(u"Non-native byte order not supported")
7791  */
7792  }
7793 
7794  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":870
7795  *
7796  * # Output padding bytes
7797  * while offset[0] < new_offset: # <<<<<<<<<<<<<<
7798  * f[0] = 120 # "x"; pad byte
7799  * f += 1
7800  */
7801  while (1) {
7802  __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 870, __pyx_L1_error)
7803  __Pyx_GOTREF(__pyx_t_3);
7804  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 870, __pyx_L1_error)
7805  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7806  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 870, __pyx_L1_error)
7807  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7808  if (!__pyx_t_6) break;
7809 
7810  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":871
7811  * # Output padding bytes
7812  * while offset[0] < new_offset:
7813  * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
7814  * f += 1
7815  * offset[0] += 1
7816  */
7817  (__pyx_v_f[0]) = 0x78;
7818 
7819  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":872
7820  * while offset[0] < new_offset:
7821  * f[0] = 120 # "x"; pad byte
7822  * f += 1 # <<<<<<<<<<<<<<
7823  * offset[0] += 1
7824  *
7825  */
7826  __pyx_v_f = (__pyx_v_f + 1);
7827 
7828  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":873
7829  * f[0] = 120 # "x"; pad byte
7830  * f += 1
7831  * offset[0] += 1 # <<<<<<<<<<<<<<
7832  *
7833  * offset[0] += child.itemsize
7834  */
7835  __pyx_t_8 = 0;
7836  (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
7837  }
7838 
7839  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":875
7840  * offset[0] += 1
7841  *
7842  * offset[0] += child.itemsize # <<<<<<<<<<<<<<
7843  *
7844  * if not PyDataType_HASFIELDS(child):
7845  */
7846  __pyx_t_8 = 0;
7847  (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
7848 
7849  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":877
7850  * offset[0] += child.itemsize
7851  *
7852  * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
7853  * t = child.type_num
7854  * if end - f < 5:
7855  */
7856  __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
7857  if (__pyx_t_6) {
7858 
7859  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":878
7860  *
7861  * if not PyDataType_HASFIELDS(child):
7862  * t = child.type_num # <<<<<<<<<<<<<<
7863  * if end - f < 5:
7864  * raise RuntimeError(u"Format string allocated too short.")
7865  */
7866  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 878, __pyx_L1_error)
7867  __Pyx_GOTREF(__pyx_t_4);
7868  __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
7869  __pyx_t_4 = 0;
7870 
7871  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":879
7872  * if not PyDataType_HASFIELDS(child):
7873  * t = child.type_num
7874  * if end - f < 5: # <<<<<<<<<<<<<<
7875  * raise RuntimeError(u"Format string allocated too short.")
7876  *
7877  */
7878  __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
7879  if (unlikely(__pyx_t_6)) {
7880 
7881  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":880
7882  * t = child.type_num
7883  * if end - f < 5:
7884  * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
7885  *
7886  * # Until ticket #99 is fixed, use integers to avoid warnings
7887  */
7888  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 880, __pyx_L1_error)
7889  __Pyx_GOTREF(__pyx_t_4);
7890  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
7891  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7892  __PYX_ERR(3, 880, __pyx_L1_error)
7893 
7894  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":879
7895  * if not PyDataType_HASFIELDS(child):
7896  * t = child.type_num
7897  * if end - f < 5: # <<<<<<<<<<<<<<
7898  * raise RuntimeError(u"Format string allocated too short.")
7899  *
7900  */
7901  }
7902 
7903  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":883
7904  *
7905  * # Until ticket #99 is fixed, use integers to avoid warnings
7906  * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
7907  * elif t == NPY_UBYTE: f[0] = 66 #"B"
7908  * elif t == NPY_SHORT: f[0] = 104 #"h"
7909  */
7910  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 883, __pyx_L1_error)
7911  __Pyx_GOTREF(__pyx_t_4);
7912  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 883, __pyx_L1_error)
7913  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7914  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 883, __pyx_L1_error)
7915  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7916  if (__pyx_t_6) {
7917  (__pyx_v_f[0]) = 98;
7918  goto __pyx_L15;
7919  }
7920 
7921  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":884
7922  * # Until ticket #99 is fixed, use integers to avoid warnings
7923  * if t == NPY_BYTE: f[0] = 98 #"b"
7924  * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
7925  * elif t == NPY_SHORT: f[0] = 104 #"h"
7926  * elif t == NPY_USHORT: f[0] = 72 #"H"
7927  */
7928  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 884, __pyx_L1_error)
7929  __Pyx_GOTREF(__pyx_t_3);
7930  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 884, __pyx_L1_error)
7931  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7932  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 884, __pyx_L1_error)
7933  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7934  if (__pyx_t_6) {
7935  (__pyx_v_f[0]) = 66;
7936  goto __pyx_L15;
7937  }
7938 
7939  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":885
7940  * if t == NPY_BYTE: f[0] = 98 #"b"
7941  * elif t == NPY_UBYTE: f[0] = 66 #"B"
7942  * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
7943  * elif t == NPY_USHORT: f[0] = 72 #"H"
7944  * elif t == NPY_INT: f[0] = 105 #"i"
7945  */
7946  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 885, __pyx_L1_error)
7947  __Pyx_GOTREF(__pyx_t_4);
7948  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 885, __pyx_L1_error)
7949  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7950  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 885, __pyx_L1_error)
7951  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7952  if (__pyx_t_6) {
7953  (__pyx_v_f[0]) = 0x68;
7954  goto __pyx_L15;
7955  }
7956 
7957  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":886
7958  * elif t == NPY_UBYTE: f[0] = 66 #"B"
7959  * elif t == NPY_SHORT: f[0] = 104 #"h"
7960  * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
7961  * elif t == NPY_INT: f[0] = 105 #"i"
7962  * elif t == NPY_UINT: f[0] = 73 #"I"
7963  */
7964  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 886, __pyx_L1_error)
7965  __Pyx_GOTREF(__pyx_t_3);
7966  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 886, __pyx_L1_error)
7967  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7968  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 886, __pyx_L1_error)
7969  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7970  if (__pyx_t_6) {
7971  (__pyx_v_f[0]) = 72;
7972  goto __pyx_L15;
7973  }
7974 
7975  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":887
7976  * elif t == NPY_SHORT: f[0] = 104 #"h"
7977  * elif t == NPY_USHORT: f[0] = 72 #"H"
7978  * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
7979  * elif t == NPY_UINT: f[0] = 73 #"I"
7980  * elif t == NPY_LONG: f[0] = 108 #"l"
7981  */
7982  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 887, __pyx_L1_error)
7983  __Pyx_GOTREF(__pyx_t_4);
7984  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 887, __pyx_L1_error)
7985  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7986  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 887, __pyx_L1_error)
7987  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7988  if (__pyx_t_6) {
7989  (__pyx_v_f[0]) = 0x69;
7990  goto __pyx_L15;
7991  }
7992 
7993  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":888
7994  * elif t == NPY_USHORT: f[0] = 72 #"H"
7995  * elif t == NPY_INT: f[0] = 105 #"i"
7996  * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
7997  * elif t == NPY_LONG: f[0] = 108 #"l"
7998  * elif t == NPY_ULONG: f[0] = 76 #"L"
7999  */
8000  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 888, __pyx_L1_error)
8001  __Pyx_GOTREF(__pyx_t_3);
8002  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 888, __pyx_L1_error)
8003  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8004  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 888, __pyx_L1_error)
8005  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8006  if (__pyx_t_6) {
8007  (__pyx_v_f[0]) = 73;
8008  goto __pyx_L15;
8009  }
8010 
8011  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":889
8012  * elif t == NPY_INT: f[0] = 105 #"i"
8013  * elif t == NPY_UINT: f[0] = 73 #"I"
8014  * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
8015  * elif t == NPY_ULONG: f[0] = 76 #"L"
8016  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
8017  */
8018  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 889, __pyx_L1_error)
8019  __Pyx_GOTREF(__pyx_t_4);
8020  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 889, __pyx_L1_error)
8021  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8022  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 889, __pyx_L1_error)
8023  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8024  if (__pyx_t_6) {
8025  (__pyx_v_f[0]) = 0x6C;
8026  goto __pyx_L15;
8027  }
8028 
8029  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":890
8030  * elif t == NPY_UINT: f[0] = 73 #"I"
8031  * elif t == NPY_LONG: f[0] = 108 #"l"
8032  * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
8033  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
8034  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
8035  */
8036  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 890, __pyx_L1_error)
8037  __Pyx_GOTREF(__pyx_t_3);
8038  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 890, __pyx_L1_error)
8039  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8040  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 890, __pyx_L1_error)
8041  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8042  if (__pyx_t_6) {
8043  (__pyx_v_f[0]) = 76;
8044  goto __pyx_L15;
8045  }
8046 
8047  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":891
8048  * elif t == NPY_LONG: f[0] = 108 #"l"
8049  * elif t == NPY_ULONG: f[0] = 76 #"L"
8050  * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
8051  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
8052  * elif t == NPY_FLOAT: f[0] = 102 #"f"
8053  */
8054  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 891, __pyx_L1_error)
8055  __Pyx_GOTREF(__pyx_t_4);
8056  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 891, __pyx_L1_error)
8057  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8058  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 891, __pyx_L1_error)
8059  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8060  if (__pyx_t_6) {
8061  (__pyx_v_f[0]) = 0x71;
8062  goto __pyx_L15;
8063  }
8064 
8065  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":892
8066  * elif t == NPY_ULONG: f[0] = 76 #"L"
8067  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
8068  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
8069  * elif t == NPY_FLOAT: f[0] = 102 #"f"
8070  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
8071  */
8072  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 892, __pyx_L1_error)
8073  __Pyx_GOTREF(__pyx_t_3);
8074  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 892, __pyx_L1_error)
8075  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8076  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 892, __pyx_L1_error)
8077  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8078  if (__pyx_t_6) {
8079  (__pyx_v_f[0]) = 81;
8080  goto __pyx_L15;
8081  }
8082 
8083  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":893
8084  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
8085  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
8086  * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
8087  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
8088  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
8089  */
8090  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 893, __pyx_L1_error)
8091  __Pyx_GOTREF(__pyx_t_4);
8092  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 893, __pyx_L1_error)
8093  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8094  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 893, __pyx_L1_error)
8095  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8096  if (__pyx_t_6) {
8097  (__pyx_v_f[0]) = 0x66;
8098  goto __pyx_L15;
8099  }
8100 
8101  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":894
8102  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
8103  * elif t == NPY_FLOAT: f[0] = 102 #"f"
8104  * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
8105  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
8106  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
8107  */
8108  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 894, __pyx_L1_error)
8109  __Pyx_GOTREF(__pyx_t_3);
8110  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 894, __pyx_L1_error)
8111  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8112  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 894, __pyx_L1_error)
8113  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8114  if (__pyx_t_6) {
8115  (__pyx_v_f[0]) = 0x64;
8116  goto __pyx_L15;
8117  }
8118 
8119  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":895
8120  * elif t == NPY_FLOAT: f[0] = 102 #"f"
8121  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
8122  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
8123  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
8124  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
8125  */
8126  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 895, __pyx_L1_error)
8127  __Pyx_GOTREF(__pyx_t_4);
8128  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 895, __pyx_L1_error)
8129  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8130  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 895, __pyx_L1_error)
8131  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8132  if (__pyx_t_6) {
8133  (__pyx_v_f[0]) = 0x67;
8134  goto __pyx_L15;
8135  }
8136 
8137  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":896
8138  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
8139  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
8140  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
8141  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
8142  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
8143  */
8144  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 896, __pyx_L1_error)
8145  __Pyx_GOTREF(__pyx_t_3);
8146  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 896, __pyx_L1_error)
8147  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8148  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 896, __pyx_L1_error)
8149  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8150  if (__pyx_t_6) {
8151  (__pyx_v_f[0]) = 90;
8152  (__pyx_v_f[1]) = 0x66;
8153  __pyx_v_f = (__pyx_v_f + 1);
8154  goto __pyx_L15;
8155  }
8156 
8157  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":897
8158  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
8159  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
8160  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
8161  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
8162  * elif t == NPY_OBJECT: f[0] = 79 #"O"
8163  */
8164  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 897, __pyx_L1_error)
8165  __Pyx_GOTREF(__pyx_t_4);
8166  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 897, __pyx_L1_error)
8167  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8168  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 897, __pyx_L1_error)
8169  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8170  if (__pyx_t_6) {
8171  (__pyx_v_f[0]) = 90;
8172  (__pyx_v_f[1]) = 0x64;
8173  __pyx_v_f = (__pyx_v_f + 1);
8174  goto __pyx_L15;
8175  }
8176 
8177  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":898
8178  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
8179  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
8180  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
8181  * elif t == NPY_OBJECT: f[0] = 79 #"O"
8182  * else:
8183  */
8184  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 898, __pyx_L1_error)
8185  __Pyx_GOTREF(__pyx_t_3);
8186  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 898, __pyx_L1_error)
8187  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8188  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 898, __pyx_L1_error)
8189  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8190  if (__pyx_t_6) {
8191  (__pyx_v_f[0]) = 90;
8192  (__pyx_v_f[1]) = 0x67;
8193  __pyx_v_f = (__pyx_v_f + 1);
8194  goto __pyx_L15;
8195  }
8196 
8197  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":899
8198  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
8199  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
8200  * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
8201  * else:
8202  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
8203  */
8204  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 899, __pyx_L1_error)
8205  __Pyx_GOTREF(__pyx_t_4);
8206  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 899, __pyx_L1_error)
8207  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8208  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 899, __pyx_L1_error)
8209  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8210  if (likely(__pyx_t_6)) {
8211  (__pyx_v_f[0]) = 79;
8212  goto __pyx_L15;
8213  }
8214 
8215  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":901
8216  * elif t == NPY_OBJECT: f[0] = 79 #"O"
8217  * else:
8218  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
8219  * f += 1
8220  * else:
8221  */
8222  /*else*/ {
8223  __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 901, __pyx_L1_error)
8224  __Pyx_GOTREF(__pyx_t_3);
8225  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 901, __pyx_L1_error)
8226  __Pyx_GOTREF(__pyx_t_4);
8227  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8228  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
8229  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8230  __PYX_ERR(3, 901, __pyx_L1_error)
8231  }
8232  __pyx_L15:;
8233 
8234  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":902
8235  * else:
8236  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
8237  * f += 1 # <<<<<<<<<<<<<<
8238  * else:
8239  * # Cython ignores struct boundary information ("T{...}"),
8240  */
8241  __pyx_v_f = (__pyx_v_f + 1);
8242 
8243  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":877
8244  * offset[0] += child.itemsize
8245  *
8246  * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
8247  * t = child.type_num
8248  * if end - f < 5:
8249  */
8250  goto __pyx_L13;
8251  }
8252 
8253  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":906
8254  * # Cython ignores struct boundary information ("T{...}"),
8255  * # so don't output it
8256  * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
8257  * return f
8258  *
8259  */
8260  /*else*/ {
8261  __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(3, 906, __pyx_L1_error)
8262  __pyx_v_f = __pyx_t_9;
8263  }
8264  __pyx_L13:;
8265 
8266  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":851
8267  * cdef tuple fields
8268  *
8269  * for childname in descr.names: # <<<<<<<<<<<<<<
8270  * fields = descr.fields[childname]
8271  * child, new_offset = fields
8272  */
8273  }
8274  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8275 
8276  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":907
8277  * # so don't output it
8278  * f = _util_dtypestring(child, f, end, offset)
8279  * return f # <<<<<<<<<<<<<<
8280  *
8281  *
8282  */
8283  __pyx_r = __pyx_v_f;
8284  goto __pyx_L0;
8285 
8286  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":842
8287  * return ()
8288  *
8289  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
8290  * # Recursive utility function used in __getbuffer__ to get format
8291  * # string. The new location in the format string is returned.
8292  */
8293 
8294  /* function exit code */
8295  __pyx_L1_error:;
8296  __Pyx_XDECREF(__pyx_t_1);
8297  __Pyx_XDECREF(__pyx_t_3);
8298  __Pyx_XDECREF(__pyx_t_4);
8299  __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
8300  __pyx_r = NULL;
8301  __pyx_L0:;
8302  __Pyx_XDECREF((PyObject *)__pyx_v_child);
8303  __Pyx_XDECREF(__pyx_v_fields);
8304  __Pyx_XDECREF(__pyx_v_childname);
8305  __Pyx_XDECREF(__pyx_v_new_offset);
8306  __Pyx_XDECREF(__pyx_v_t);
8307  __Pyx_TraceReturn(Py_None, 0);
8308  __Pyx_RefNannyFinishContext();
8309  return __pyx_r;
8310 }
8311 
8312 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1022
8313  * int _import_umath() except -1
8314  *
8315  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
8316  * Py_INCREF(base) # important to do this before stealing the reference below!
8317  * PyArray_SetBaseObject(arr, base)
8318  */
8319 
8320 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
8321  __Pyx_TraceDeclarations
8322  __Pyx_RefNannyDeclarations
8323  __Pyx_RefNannySetupContext("set_array_base", 0);
8324  __Pyx_TraceCall("set_array_base", __pyx_f[3], 1022, 0, __PYX_ERR(3, 1022, __pyx_L1_error));
8325 
8326  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1023
8327  *
8328  * cdef inline void set_array_base(ndarray arr, object base):
8329  * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
8330  * PyArray_SetBaseObject(arr, base)
8331  *
8332  */
8333  Py_INCREF(__pyx_v_base);
8334 
8335  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1024
8336  * cdef inline void set_array_base(ndarray arr, object base):
8337  * Py_INCREF(base) # important to do this before stealing the reference below!
8338  * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
8339  *
8340  * cdef inline object get_array_base(ndarray arr):
8341  */
8342  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
8343 
8344  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1022
8345  * int _import_umath() except -1
8346  *
8347  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
8348  * Py_INCREF(base) # important to do this before stealing the reference below!
8349  * PyArray_SetBaseObject(arr, base)
8350  */
8351 
8352  /* function exit code */
8353  goto __pyx_L0;
8354  __pyx_L1_error:;
8355  __Pyx_WriteUnraisable("numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
8356  __pyx_L0:;
8357  __Pyx_TraceReturn(Py_None, 0);
8358  __Pyx_RefNannyFinishContext();
8359 }
8360 
8361 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1026
8362  * PyArray_SetBaseObject(arr, base)
8363  *
8364  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
8365  * base = PyArray_BASE(arr)
8366  * if base is NULL:
8367  */
8368 
8369 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
8370  PyObject *__pyx_v_base;
8371  PyObject *__pyx_r = NULL;
8372  __Pyx_TraceDeclarations
8373  __Pyx_RefNannyDeclarations
8374  int __pyx_t_1;
8375  __Pyx_RefNannySetupContext("get_array_base", 0);
8376  __Pyx_TraceCall("get_array_base", __pyx_f[3], 1026, 0, __PYX_ERR(3, 1026, __pyx_L1_error));
8377 
8378  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1027
8379  *
8380  * cdef inline object get_array_base(ndarray arr):
8381  * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
8382  * if base is NULL:
8383  * return None
8384  */
8385  __pyx_v_base = PyArray_BASE(__pyx_v_arr);
8386 
8387  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1028
8388  * cdef inline object get_array_base(ndarray arr):
8389  * base = PyArray_BASE(arr)
8390  * if base is NULL: # <<<<<<<<<<<<<<
8391  * return None
8392  * return <object>base
8393  */
8394  __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
8395  if (__pyx_t_1) {
8396 
8397  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1029
8398  * base = PyArray_BASE(arr)
8399  * if base is NULL:
8400  * return None # <<<<<<<<<<<<<<
8401  * return <object>base
8402  *
8403  */
8404  __Pyx_XDECREF(__pyx_r);
8405  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8406  goto __pyx_L0;
8407 
8408  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1028
8409  * cdef inline object get_array_base(ndarray arr):
8410  * base = PyArray_BASE(arr)
8411  * if base is NULL: # <<<<<<<<<<<<<<
8412  * return None
8413  * return <object>base
8414  */
8415  }
8416 
8417  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1030
8418  * if base is NULL:
8419  * return None
8420  * return <object>base # <<<<<<<<<<<<<<
8421  *
8422  * # Versions of the import_* functions which are more suitable for
8423  */
8424  __Pyx_XDECREF(__pyx_r);
8425  __Pyx_INCREF(((PyObject *)__pyx_v_base));
8426  __pyx_r = ((PyObject *)__pyx_v_base);
8427  goto __pyx_L0;
8428 
8429  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1026
8430  * PyArray_SetBaseObject(arr, base)
8431  *
8432  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
8433  * base = PyArray_BASE(arr)
8434  * if base is NULL:
8435  */
8436 
8437  /* function exit code */
8438  __pyx_L1_error:;
8439  __Pyx_AddTraceback("numpy.get_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
8440  __pyx_r = 0;
8441  __pyx_L0:;
8442  __Pyx_XGIVEREF(__pyx_r);
8443  __Pyx_TraceReturn(__pyx_r, 0);
8444  __Pyx_RefNannyFinishContext();
8445  return __pyx_r;
8446 }
8447 
8448 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1034
8449  * # Versions of the import_* functions which are more suitable for
8450  * # Cython code.
8451  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
8452  * try:
8453  * _import_array()
8454  */
8455 
8456 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
8457  int __pyx_r;
8458  __Pyx_TraceDeclarations
8459  __Pyx_RefNannyDeclarations
8460  PyObject *__pyx_t_1 = NULL;
8461  PyObject *__pyx_t_2 = NULL;
8462  PyObject *__pyx_t_3 = NULL;
8463  int __pyx_t_4;
8464  PyObject *__pyx_t_5 = NULL;
8465  PyObject *__pyx_t_6 = NULL;
8466  PyObject *__pyx_t_7 = NULL;
8467  PyObject *__pyx_t_8 = NULL;
8468  __Pyx_RefNannySetupContext("import_array", 0);
8469  __Pyx_TraceCall("import_array", __pyx_f[3], 1034, 0, __PYX_ERR(3, 1034, __pyx_L1_error));
8470 
8471  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1035
8472  * # Cython code.
8473  * cdef inline int import_array() except -1:
8474  * try: # <<<<<<<<<<<<<<
8475  * _import_array()
8476  * except Exception:
8477  */
8478  {
8479  __Pyx_PyThreadState_declare
8480  __Pyx_PyThreadState_assign
8481  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8482  __Pyx_XGOTREF(__pyx_t_1);
8483  __Pyx_XGOTREF(__pyx_t_2);
8484  __Pyx_XGOTREF(__pyx_t_3);
8485  /*try:*/ {
8486 
8487  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1036
8488  * cdef inline int import_array() except -1:
8489  * try:
8490  * _import_array() # <<<<<<<<<<<<<<
8491  * except Exception:
8492  * raise ImportError("numpy.core.multiarray failed to import")
8493  */
8494  __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 1036, __pyx_L3_error)
8495 
8496  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1035
8497  * # Cython code.
8498  * cdef inline int import_array() except -1:
8499  * try: # <<<<<<<<<<<<<<
8500  * _import_array()
8501  * except Exception:
8502  */
8503  }
8504  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8505  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8506  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8507  goto __pyx_L8_try_end;
8508  __pyx_L3_error:;
8509 
8510  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1037
8511  * try:
8512  * _import_array()
8513  * except Exception: # <<<<<<<<<<<<<<
8514  * raise ImportError("numpy.core.multiarray failed to import")
8515  *
8516  */
8517  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8518  if (__pyx_t_4) {
8519  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
8520  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1037, __pyx_L5_except_error)
8521  __Pyx_GOTREF(__pyx_t_5);
8522  __Pyx_GOTREF(__pyx_t_6);
8523  __Pyx_GOTREF(__pyx_t_7);
8524 
8525  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1038
8526  * _import_array()
8527  * except Exception:
8528  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
8529  *
8530  * cdef inline int import_umath() except -1:
8531  */
8532  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1038, __pyx_L5_except_error)
8533  __Pyx_GOTREF(__pyx_t_8);
8534  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8535  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8536  __PYX_ERR(3, 1038, __pyx_L5_except_error)
8537  }
8538  goto __pyx_L5_except_error;
8539  __pyx_L5_except_error:;
8540 
8541  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1035
8542  * # Cython code.
8543  * cdef inline int import_array() except -1:
8544  * try: # <<<<<<<<<<<<<<
8545  * _import_array()
8546  * except Exception:
8547  */
8548  __Pyx_XGIVEREF(__pyx_t_1);
8549  __Pyx_XGIVEREF(__pyx_t_2);
8550  __Pyx_XGIVEREF(__pyx_t_3);
8551  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8552  goto __pyx_L1_error;
8553  __pyx_L8_try_end:;
8554  }
8555 
8556  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1034
8557  * # Versions of the import_* functions which are more suitable for
8558  * # Cython code.
8559  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
8560  * try:
8561  * _import_array()
8562  */
8563 
8564  /* function exit code */
8565  __pyx_r = 0;
8566  goto __pyx_L0;
8567  __pyx_L1_error:;
8568  __Pyx_XDECREF(__pyx_t_5);
8569  __Pyx_XDECREF(__pyx_t_6);
8570  __Pyx_XDECREF(__pyx_t_7);
8571  __Pyx_XDECREF(__pyx_t_8);
8572  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
8573  __pyx_r = -1;
8574  __pyx_L0:;
8575  __Pyx_TraceReturn(Py_None, 0);
8576  __Pyx_RefNannyFinishContext();
8577  return __pyx_r;
8578 }
8579 
8580 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1040
8581  * raise ImportError("numpy.core.multiarray failed to import")
8582  *
8583  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
8584  * try:
8585  * _import_umath()
8586  */
8587 
8588 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
8589  int __pyx_r;
8590  __Pyx_TraceDeclarations
8591  __Pyx_RefNannyDeclarations
8592  PyObject *__pyx_t_1 = NULL;
8593  PyObject *__pyx_t_2 = NULL;
8594  PyObject *__pyx_t_3 = NULL;
8595  int __pyx_t_4;
8596  PyObject *__pyx_t_5 = NULL;
8597  PyObject *__pyx_t_6 = NULL;
8598  PyObject *__pyx_t_7 = NULL;
8599  PyObject *__pyx_t_8 = NULL;
8600  __Pyx_RefNannySetupContext("import_umath", 0);
8601  __Pyx_TraceCall("import_umath", __pyx_f[3], 1040, 0, __PYX_ERR(3, 1040, __pyx_L1_error));
8602 
8603  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1041
8604  *
8605  * cdef inline int import_umath() except -1:
8606  * try: # <<<<<<<<<<<<<<
8607  * _import_umath()
8608  * except Exception:
8609  */
8610  {
8611  __Pyx_PyThreadState_declare
8612  __Pyx_PyThreadState_assign
8613  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8614  __Pyx_XGOTREF(__pyx_t_1);
8615  __Pyx_XGOTREF(__pyx_t_2);
8616  __Pyx_XGOTREF(__pyx_t_3);
8617  /*try:*/ {
8618 
8619  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1042
8620  * cdef inline int import_umath() except -1:
8621  * try:
8622  * _import_umath() # <<<<<<<<<<<<<<
8623  * except Exception:
8624  * raise ImportError("numpy.core.umath failed to import")
8625  */
8626  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 1042, __pyx_L3_error)
8627 
8628  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1041
8629  *
8630  * cdef inline int import_umath() except -1:
8631  * try: # <<<<<<<<<<<<<<
8632  * _import_umath()
8633  * except Exception:
8634  */
8635  }
8636  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8637  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8638  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8639  goto __pyx_L8_try_end;
8640  __pyx_L3_error:;
8641 
8642  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1043
8643  * try:
8644  * _import_umath()
8645  * except Exception: # <<<<<<<<<<<<<<
8646  * raise ImportError("numpy.core.umath failed to import")
8647  *
8648  */
8649  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8650  if (__pyx_t_4) {
8651  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
8652  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1043, __pyx_L5_except_error)
8653  __Pyx_GOTREF(__pyx_t_5);
8654  __Pyx_GOTREF(__pyx_t_6);
8655  __Pyx_GOTREF(__pyx_t_7);
8656 
8657  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1044
8658  * _import_umath()
8659  * except Exception:
8660  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
8661  *
8662  * cdef inline int import_ufunc() except -1:
8663  */
8664  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1044, __pyx_L5_except_error)
8665  __Pyx_GOTREF(__pyx_t_8);
8666  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8667  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8668  __PYX_ERR(3, 1044, __pyx_L5_except_error)
8669  }
8670  goto __pyx_L5_except_error;
8671  __pyx_L5_except_error:;
8672 
8673  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1041
8674  *
8675  * cdef inline int import_umath() except -1:
8676  * try: # <<<<<<<<<<<<<<
8677  * _import_umath()
8678  * except Exception:
8679  */
8680  __Pyx_XGIVEREF(__pyx_t_1);
8681  __Pyx_XGIVEREF(__pyx_t_2);
8682  __Pyx_XGIVEREF(__pyx_t_3);
8683  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8684  goto __pyx_L1_error;
8685  __pyx_L8_try_end:;
8686  }
8687 
8688  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1040
8689  * raise ImportError("numpy.core.multiarray failed to import")
8690  *
8691  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
8692  * try:
8693  * _import_umath()
8694  */
8695 
8696  /* function exit code */
8697  __pyx_r = 0;
8698  goto __pyx_L0;
8699  __pyx_L1_error:;
8700  __Pyx_XDECREF(__pyx_t_5);
8701  __Pyx_XDECREF(__pyx_t_6);
8702  __Pyx_XDECREF(__pyx_t_7);
8703  __Pyx_XDECREF(__pyx_t_8);
8704  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
8705  __pyx_r = -1;
8706  __pyx_L0:;
8707  __Pyx_TraceReturn(Py_None, 0);
8708  __Pyx_RefNannyFinishContext();
8709  return __pyx_r;
8710 }
8711 
8712 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1046
8713  * raise ImportError("numpy.core.umath failed to import")
8714  *
8715  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
8716  * try:
8717  * _import_umath()
8718  */
8719 
8720 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
8721  int __pyx_r;
8722  __Pyx_TraceDeclarations
8723  __Pyx_RefNannyDeclarations
8724  PyObject *__pyx_t_1 = NULL;
8725  PyObject *__pyx_t_2 = NULL;
8726  PyObject *__pyx_t_3 = NULL;
8727  int __pyx_t_4;
8728  PyObject *__pyx_t_5 = NULL;
8729  PyObject *__pyx_t_6 = NULL;
8730  PyObject *__pyx_t_7 = NULL;
8731  PyObject *__pyx_t_8 = NULL;
8732  __Pyx_RefNannySetupContext("import_ufunc", 0);
8733  __Pyx_TraceCall("import_ufunc", __pyx_f[3], 1046, 0, __PYX_ERR(3, 1046, __pyx_L1_error));
8734 
8735  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1047
8736  *
8737  * cdef inline int import_ufunc() except -1:
8738  * try: # <<<<<<<<<<<<<<
8739  * _import_umath()
8740  * except Exception:
8741  */
8742  {
8743  __Pyx_PyThreadState_declare
8744  __Pyx_PyThreadState_assign
8745  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8746  __Pyx_XGOTREF(__pyx_t_1);
8747  __Pyx_XGOTREF(__pyx_t_2);
8748  __Pyx_XGOTREF(__pyx_t_3);
8749  /*try:*/ {
8750 
8751  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1048
8752  * cdef inline int import_ufunc() except -1:
8753  * try:
8754  * _import_umath() # <<<<<<<<<<<<<<
8755  * except Exception:
8756  * raise ImportError("numpy.core.umath failed to import")
8757  */
8758  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 1048, __pyx_L3_error)
8759 
8760  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1047
8761  *
8762  * cdef inline int import_ufunc() except -1:
8763  * try: # <<<<<<<<<<<<<<
8764  * _import_umath()
8765  * except Exception:
8766  */
8767  }
8768  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8769  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8770  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8771  goto __pyx_L8_try_end;
8772  __pyx_L3_error:;
8773 
8774  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1049
8775  * try:
8776  * _import_umath()
8777  * except Exception: # <<<<<<<<<<<<<<
8778  * raise ImportError("numpy.core.umath failed to import")
8779  */
8780  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8781  if (__pyx_t_4) {
8782  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8783  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1049, __pyx_L5_except_error)
8784  __Pyx_GOTREF(__pyx_t_5);
8785  __Pyx_GOTREF(__pyx_t_6);
8786  __Pyx_GOTREF(__pyx_t_7);
8787 
8788  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1050
8789  * _import_umath()
8790  * except Exception:
8791  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
8792  */
8793  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1050, __pyx_L5_except_error)
8794  __Pyx_GOTREF(__pyx_t_8);
8795  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8796  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8797  __PYX_ERR(3, 1050, __pyx_L5_except_error)
8798  }
8799  goto __pyx_L5_except_error;
8800  __pyx_L5_except_error:;
8801 
8802  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1047
8803  *
8804  * cdef inline int import_ufunc() except -1:
8805  * try: # <<<<<<<<<<<<<<
8806  * _import_umath()
8807  * except Exception:
8808  */
8809  __Pyx_XGIVEREF(__pyx_t_1);
8810  __Pyx_XGIVEREF(__pyx_t_2);
8811  __Pyx_XGIVEREF(__pyx_t_3);
8812  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8813  goto __pyx_L1_error;
8814  __pyx_L8_try_end:;
8815  }
8816 
8817  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1046
8818  * raise ImportError("numpy.core.umath failed to import")
8819  *
8820  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
8821  * try:
8822  * _import_umath()
8823  */
8824 
8825  /* function exit code */
8826  __pyx_r = 0;
8827  goto __pyx_L0;
8828  __pyx_L1_error:;
8829  __Pyx_XDECREF(__pyx_t_5);
8830  __Pyx_XDECREF(__pyx_t_6);
8831  __Pyx_XDECREF(__pyx_t_7);
8832  __Pyx_XDECREF(__pyx_t_8);
8833  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8834  __pyx_r = -1;
8835  __pyx_L0:;
8836  __Pyx_TraceReturn(Py_None, 0);
8837  __Pyx_RefNannyFinishContext();
8838  return __pyx_r;
8839 }
8840 
8841 /* "View.MemoryView":122
8842  * cdef bint dtype_is_object
8843  *
8844  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
8845  * mode="c", bint allocate_buffer=True):
8846  *
8847  */
8848 
8849 /* Python wrapper */
8850 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8851 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8852  PyObject *__pyx_v_shape = 0;
8853  Py_ssize_t __pyx_v_itemsize;
8854  PyObject *__pyx_v_format = 0;
8855  PyObject *__pyx_v_mode = 0;
8856  int __pyx_v_allocate_buffer;
8857  int __pyx_r;
8858  __Pyx_RefNannyDeclarations
8859  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
8860  {
8861  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
8862  PyObject* values[5] = {0,0,0,0,0};
8863  values[3] = ((PyObject *)__pyx_n_s_c);
8864  if (unlikely(__pyx_kwds)) {
8865  Py_ssize_t kw_args;
8866  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8867  switch (pos_args) {
8868  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8869  CYTHON_FALLTHROUGH;
8870  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8871  CYTHON_FALLTHROUGH;
8872  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8873  CYTHON_FALLTHROUGH;
8874  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8875  CYTHON_FALLTHROUGH;
8876  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8877  CYTHON_FALLTHROUGH;
8878  case 0: break;
8879  default: goto __pyx_L5_argtuple_error;
8880  }
8881  kw_args = PyDict_Size(__pyx_kwds);
8882  switch (pos_args) {
8883  case 0:
8884  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
8885  else goto __pyx_L5_argtuple_error;
8886  CYTHON_FALLTHROUGH;
8887  case 1:
8888  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
8889  else {
8890  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error)
8891  }
8892  CYTHON_FALLTHROUGH;
8893  case 2:
8894  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
8895  else {
8896  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error)
8897  }
8898  CYTHON_FALLTHROUGH;
8899  case 3:
8900  if (kw_args > 0) {
8901  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
8902  if (value) { values[3] = value; kw_args--; }
8903  }
8904  CYTHON_FALLTHROUGH;
8905  case 4:
8906  if (kw_args > 0) {
8907  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
8908  if (value) { values[4] = value; kw_args--; }
8909  }
8910  }
8911  if (unlikely(kw_args > 0)) {
8912  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error)
8913  }
8914  } else {
8915  switch (PyTuple_GET_SIZE(__pyx_args)) {
8916  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8917  CYTHON_FALLTHROUGH;
8918  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8919  CYTHON_FALLTHROUGH;
8920  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8921  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8922  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8923  break;
8924  default: goto __pyx_L5_argtuple_error;
8925  }
8926  }
8927  __pyx_v_shape = ((PyObject*)values[0]);
8928  __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
8929  __pyx_v_format = values[2];
8930  __pyx_v_mode = values[3];
8931  if (values[4]) {
8932  __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
8933  } else {
8934 
8935  /* "View.MemoryView":123
8936  *
8937  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
8938  * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
8939  *
8940  * cdef int idx
8941  */
8942  __pyx_v_allocate_buffer = ((int)1);
8943  }
8944  }
8945  goto __pyx_L4_argument_unpacking_done;
8946  __pyx_L5_argtuple_error:;
8947  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 122, __pyx_L3_error)
8948  __pyx_L3_error:;
8949  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8950  __Pyx_RefNannyFinishContext();
8951  return -1;
8952  __pyx_L4_argument_unpacking_done:;
8953  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 122, __pyx_L1_error)
8954  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
8955  PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 122, __pyx_L1_error)
8956  }
8957  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
8958 
8959  /* "View.MemoryView":122
8960  * cdef bint dtype_is_object
8961  *
8962  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
8963  * mode="c", bint allocate_buffer=True):
8964  *
8965  */
8966 
8967  /* function exit code */
8968  goto __pyx_L0;
8969  __pyx_L1_error:;
8970  __pyx_r = -1;
8971  __pyx_L0:;
8972  __Pyx_RefNannyFinishContext();
8973  return __pyx_r;
8974 }
8975 
8976 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
8977  int __pyx_v_idx;
8978  Py_ssize_t __pyx_v_i;
8979  Py_ssize_t __pyx_v_dim;
8980  PyObject **__pyx_v_p;
8981  char __pyx_v_order;
8982  int __pyx_r;
8983  __Pyx_TraceDeclarations
8984  __Pyx_RefNannyDeclarations
8985  Py_ssize_t __pyx_t_1;
8986  int __pyx_t_2;
8987  PyObject *__pyx_t_3 = NULL;
8988  int __pyx_t_4;
8989  PyObject *__pyx_t_5 = NULL;
8990  PyObject *__pyx_t_6 = NULL;
8991  char *__pyx_t_7;
8992  int __pyx_t_8;
8993  Py_ssize_t __pyx_t_9;
8994  PyObject *__pyx_t_10 = NULL;
8995  Py_ssize_t __pyx_t_11;
8996  __Pyx_RefNannySetupContext("__cinit__", 0);
8997  __Pyx_TraceCall("__cinit__", __pyx_f[1], 122, 0, __PYX_ERR(1, 122, __pyx_L1_error));
8998  __Pyx_INCREF(__pyx_v_format);
8999 
9000  /* "View.MemoryView":129
9001  * cdef PyObject **p
9002  *
9003  * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
9004  * self.itemsize = itemsize
9005  *
9006  */
9007  if (unlikely(__pyx_v_shape == Py_None)) {
9008  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
9009  __PYX_ERR(1, 129, __pyx_L1_error)
9010  }
9011  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 129, __pyx_L1_error)
9012  __pyx_v_self->ndim = ((int)__pyx_t_1);
9013 
9014  /* "View.MemoryView":130
9015  *
9016  * self.ndim = <int> len(shape)
9017  * self.itemsize = itemsize # <<<<<<<<<<<<<<
9018  *
9019  * if not self.ndim:
9020  */
9021  __pyx_v_self->itemsize = __pyx_v_itemsize;
9022 
9023  /* "View.MemoryView":132
9024  * self.itemsize = itemsize
9025  *
9026  * if not self.ndim: # <<<<<<<<<<<<<<
9027  * raise ValueError("Empty shape tuple for cython.array")
9028  *
9029  */
9030  __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
9031  if (unlikely(__pyx_t_2)) {
9032 
9033  /* "View.MemoryView":133
9034  *
9035  * if not self.ndim:
9036  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
9037  *
9038  * if itemsize <= 0:
9039  */
9040  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error)
9041  __Pyx_GOTREF(__pyx_t_3);
9042  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9043  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9044  __PYX_ERR(1, 133, __pyx_L1_error)
9045 
9046  /* "View.MemoryView":132
9047  * self.itemsize = itemsize
9048  *
9049  * if not self.ndim: # <<<<<<<<<<<<<<
9050  * raise ValueError("Empty shape tuple for cython.array")
9051  *
9052  */
9053  }
9054 
9055  /* "View.MemoryView":135
9056  * raise ValueError("Empty shape tuple for cython.array")
9057  *
9058  * if itemsize <= 0: # <<<<<<<<<<<<<<
9059  * raise ValueError("itemsize <= 0 for cython.array")
9060  *
9061  */
9062  __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
9063  if (unlikely(__pyx_t_2)) {
9064 
9065  /* "View.MemoryView":136
9066  *
9067  * if itemsize <= 0:
9068  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
9069  *
9070  * if not isinstance(format, bytes):
9071  */
9072  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 136, __pyx_L1_error)
9073  __Pyx_GOTREF(__pyx_t_3);
9074  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9075  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9076  __PYX_ERR(1, 136, __pyx_L1_error)
9077 
9078  /* "View.MemoryView":135
9079  * raise ValueError("Empty shape tuple for cython.array")
9080  *
9081  * if itemsize <= 0: # <<<<<<<<<<<<<<
9082  * raise ValueError("itemsize <= 0 for cython.array")
9083  *
9084  */
9085  }
9086 
9087  /* "View.MemoryView":138
9088  * raise ValueError("itemsize <= 0 for cython.array")
9089  *
9090  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
9091  * format = format.encode('ASCII')
9092  * self._format = format # keep a reference to the byte string
9093  */
9094  __pyx_t_2 = PyBytes_Check(__pyx_v_format);
9095  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
9096  if (__pyx_t_4) {
9097 
9098  /* "View.MemoryView":139
9099  *
9100  * if not isinstance(format, bytes):
9101  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
9102  * self._format = format # keep a reference to the byte string
9103  * self.format = self._format
9104  */
9105  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error)
9106  __Pyx_GOTREF(__pyx_t_5);
9107  __pyx_t_6 = NULL;
9108  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
9109  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
9110  if (likely(__pyx_t_6)) {
9111  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
9112  __Pyx_INCREF(__pyx_t_6);
9113  __Pyx_INCREF(function);
9114  __Pyx_DECREF_SET(__pyx_t_5, function);
9115  }
9116  }
9117  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
9118  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9119  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error)
9120  __Pyx_GOTREF(__pyx_t_3);
9121  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9122  __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
9123  __pyx_t_3 = 0;
9124 
9125  /* "View.MemoryView":138
9126  * raise ValueError("itemsize <= 0 for cython.array")
9127  *
9128  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
9129  * format = format.encode('ASCII')
9130  * self._format = format # keep a reference to the byte string
9131  */
9132  }
9133 
9134  /* "View.MemoryView":140
9135  * if not isinstance(format, bytes):
9136  * format = format.encode('ASCII')
9137  * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
9138  * self.format = self._format
9139  *
9140  */
9141  if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 140, __pyx_L1_error)
9142  __pyx_t_3 = __pyx_v_format;
9143  __Pyx_INCREF(__pyx_t_3);
9144  __Pyx_GIVEREF(__pyx_t_3);
9145  __Pyx_GOTREF(__pyx_v_self->_format);
9146  __Pyx_DECREF(__pyx_v_self->_format);
9147  __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
9148  __pyx_t_3 = 0;
9149 
9150  /* "View.MemoryView":141
9151  * format = format.encode('ASCII')
9152  * self._format = format # keep a reference to the byte string
9153  * self.format = self._format # <<<<<<<<<<<<<<
9154  *
9155  *
9156  */
9157  if (unlikely(__pyx_v_self->_format == Py_None)) {
9158  PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
9159  __PYX_ERR(1, 141, __pyx_L1_error)
9160  }
9161  __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error)
9162  __pyx_v_self->format = __pyx_t_7;
9163 
9164  /* "View.MemoryView":144
9165  *
9166  *
9167  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
9168  * self._strides = self._shape + self.ndim
9169  *
9170  */
9171  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
9172 
9173  /* "View.MemoryView":145
9174  *
9175  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
9176  * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
9177  *
9178  * if not self._shape:
9179  */
9180  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
9181 
9182  /* "View.MemoryView":147
9183  * self._strides = self._shape + self.ndim
9184  *
9185  * if not self._shape: # <<<<<<<<<<<<<<
9186  * raise MemoryError("unable to allocate shape and strides.")
9187  *
9188  */
9189  __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
9190  if (unlikely(__pyx_t_4)) {
9191 
9192  /* "View.MemoryView":148
9193  *
9194  * if not self._shape:
9195  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
9196  *
9197  *
9198  */
9199  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error)
9200  __Pyx_GOTREF(__pyx_t_3);
9201  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9202  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9203  __PYX_ERR(1, 148, __pyx_L1_error)
9204 
9205  /* "View.MemoryView":147
9206  * self._strides = self._shape + self.ndim
9207  *
9208  * if not self._shape: # <<<<<<<<<<<<<<
9209  * raise MemoryError("unable to allocate shape and strides.")
9210  *
9211  */
9212  }
9213 
9214  /* "View.MemoryView":151
9215  *
9216  *
9217  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
9218  * if dim <= 0:
9219  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
9220  */
9221  __pyx_t_8 = 0;
9222  __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
9223  for (;;) {
9224  if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
9225  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9226  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 151, __pyx_L1_error)
9227  #else
9228  __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 151, __pyx_L1_error)
9229  __Pyx_GOTREF(__pyx_t_5);
9230  #endif
9231  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L1_error)
9232  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9233  __pyx_v_dim = __pyx_t_9;
9234  __pyx_v_idx = __pyx_t_8;
9235  __pyx_t_8 = (__pyx_t_8 + 1);
9236 
9237  /* "View.MemoryView":152
9238  *
9239  * for idx, dim in enumerate(shape):
9240  * if dim <= 0: # <<<<<<<<<<<<<<
9241  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
9242  * self._shape[idx] = dim
9243  */
9244  __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
9245  if (unlikely(__pyx_t_4)) {
9246 
9247  /* "View.MemoryView":153
9248  * for idx, dim in enumerate(shape):
9249  * if dim <= 0:
9250  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
9251  * self._shape[idx] = dim
9252  *
9253  */
9254  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
9255  __Pyx_GOTREF(__pyx_t_5);
9256  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
9257  __Pyx_GOTREF(__pyx_t_6);
9258  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
9259  __Pyx_GOTREF(__pyx_t_10);
9260  __Pyx_GIVEREF(__pyx_t_5);
9261  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
9262  __Pyx_GIVEREF(__pyx_t_6);
9263  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
9264  __pyx_t_5 = 0;
9265  __pyx_t_6 = 0;
9266  __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
9267  __Pyx_GOTREF(__pyx_t_6);
9268  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9269  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
9270  __Pyx_GOTREF(__pyx_t_10);
9271  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9272  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
9273  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9274  __PYX_ERR(1, 153, __pyx_L1_error)
9275 
9276  /* "View.MemoryView":152
9277  *
9278  * for idx, dim in enumerate(shape):
9279  * if dim <= 0: # <<<<<<<<<<<<<<
9280  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
9281  * self._shape[idx] = dim
9282  */
9283  }
9284 
9285  /* "View.MemoryView":154
9286  * if dim <= 0:
9287  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
9288  * self._shape[idx] = dim # <<<<<<<<<<<<<<
9289  *
9290  * cdef char order
9291  */
9292  (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
9293 
9294  /* "View.MemoryView":151
9295  *
9296  *
9297  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
9298  * if dim <= 0:
9299  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
9300  */
9301  }
9302  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9303 
9304  /* "View.MemoryView":157
9305  *
9306  * cdef char order
9307  * if mode == 'fortran': # <<<<<<<<<<<<<<
9308  * order = b'F'
9309  * self.mode = u'fortran'
9310  */
9311  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 157, __pyx_L1_error)
9312  if (__pyx_t_4) {
9313 
9314  /* "View.MemoryView":158
9315  * cdef char order
9316  * if mode == 'fortran':
9317  * order = b'F' # <<<<<<<<<<<<<<
9318  * self.mode = u'fortran'
9319  * elif mode == 'c':
9320  */
9321  __pyx_v_order = 'F';
9322 
9323  /* "View.MemoryView":159
9324  * if mode == 'fortran':
9325  * order = b'F'
9326  * self.mode = u'fortran' # <<<<<<<<<<<<<<
9327  * elif mode == 'c':
9328  * order = b'C'
9329  */
9330  __Pyx_INCREF(__pyx_n_u_fortran);
9331  __Pyx_GIVEREF(__pyx_n_u_fortran);
9332  __Pyx_GOTREF(__pyx_v_self->mode);
9333  __Pyx_DECREF(__pyx_v_self->mode);
9334  __pyx_v_self->mode = __pyx_n_u_fortran;
9335 
9336  /* "View.MemoryView":157
9337  *
9338  * cdef char order
9339  * if mode == 'fortran': # <<<<<<<<<<<<<<
9340  * order = b'F'
9341  * self.mode = u'fortran'
9342  */
9343  goto __pyx_L10;
9344  }
9345 
9346  /* "View.MemoryView":160
9347  * order = b'F'
9348  * self.mode = u'fortran'
9349  * elif mode == 'c': # <<<<<<<<<<<<<<
9350  * order = b'C'
9351  * self.mode = u'c'
9352  */
9353  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 160, __pyx_L1_error)
9354  if (likely(__pyx_t_4)) {
9355 
9356  /* "View.MemoryView":161
9357  * self.mode = u'fortran'
9358  * elif mode == 'c':
9359  * order = b'C' # <<<<<<<<<<<<<<
9360  * self.mode = u'c'
9361  * else:
9362  */
9363  __pyx_v_order = 'C';
9364 
9365  /* "View.MemoryView":162
9366  * elif mode == 'c':
9367  * order = b'C'
9368  * self.mode = u'c' # <<<<<<<<<<<<<<
9369  * else:
9370  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
9371  */
9372  __Pyx_INCREF(__pyx_n_u_c);
9373  __Pyx_GIVEREF(__pyx_n_u_c);
9374  __Pyx_GOTREF(__pyx_v_self->mode);
9375  __Pyx_DECREF(__pyx_v_self->mode);
9376  __pyx_v_self->mode = __pyx_n_u_c;
9377 
9378  /* "View.MemoryView":160
9379  * order = b'F'
9380  * self.mode = u'fortran'
9381  * elif mode == 'c': # <<<<<<<<<<<<<<
9382  * order = b'C'
9383  * self.mode = u'c'
9384  */
9385  goto __pyx_L10;
9386  }
9387 
9388  /* "View.MemoryView":164
9389  * self.mode = u'c'
9390  * else:
9391  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
9392  *
9393  * self.len = fill_contig_strides_array(self._shape, self._strides,
9394  */
9395  /*else*/ {
9396  __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 164, __pyx_L1_error)
9397  __Pyx_GOTREF(__pyx_t_3);
9398  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 164, __pyx_L1_error)
9399  __Pyx_GOTREF(__pyx_t_10);
9400  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9401  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
9402  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9403  __PYX_ERR(1, 164, __pyx_L1_error)
9404  }
9405  __pyx_L10:;
9406 
9407  /* "View.MemoryView":166
9408  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
9409  *
9410  * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
9411  * itemsize, self.ndim, order)
9412  *
9413  */
9414  __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
9415 
9416  /* "View.MemoryView":169
9417  * itemsize, self.ndim, order)
9418  *
9419  * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
9420  * self.dtype_is_object = format == b'O'
9421  * if allocate_buffer:
9422  */
9423  __pyx_v_self->free_data = __pyx_v_allocate_buffer;
9424 
9425  /* "View.MemoryView":170
9426  *
9427  * self.free_data = allocate_buffer
9428  * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
9429  * if allocate_buffer:
9430  *
9431  */
9432  __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 170, __pyx_L1_error)
9433  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L1_error)
9434  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9435  __pyx_v_self->dtype_is_object = __pyx_t_4;
9436 
9437  /* "View.MemoryView":171
9438  * self.free_data = allocate_buffer
9439  * self.dtype_is_object = format == b'O'
9440  * if allocate_buffer: # <<<<<<<<<<<<<<
9441  *
9442  *
9443  */
9444  __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
9445  if (__pyx_t_4) {
9446 
9447  /* "View.MemoryView":174
9448  *
9449  *
9450  * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
9451  * if not self.data:
9452  * raise MemoryError("unable to allocate array data.")
9453  */
9454  __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
9455 
9456  /* "View.MemoryView":175
9457  *
9458  * self.data = <char *>malloc(self.len)
9459  * if not self.data: # <<<<<<<<<<<<<<
9460  * raise MemoryError("unable to allocate array data.")
9461  *
9462  */
9463  __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
9464  if (unlikely(__pyx_t_4)) {
9465 
9466  /* "View.MemoryView":176
9467  * self.data = <char *>malloc(self.len)
9468  * if not self.data:
9469  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
9470  *
9471  * if self.dtype_is_object:
9472  */
9473  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 176, __pyx_L1_error)
9474  __Pyx_GOTREF(__pyx_t_10);
9475  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
9476  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9477  __PYX_ERR(1, 176, __pyx_L1_error)
9478 
9479  /* "View.MemoryView":175
9480  *
9481  * self.data = <char *>malloc(self.len)
9482  * if not self.data: # <<<<<<<<<<<<<<
9483  * raise MemoryError("unable to allocate array data.")
9484  *
9485  */
9486  }
9487 
9488  /* "View.MemoryView":178
9489  * raise MemoryError("unable to allocate array data.")
9490  *
9491  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9492  * p = <PyObject **> self.data
9493  * for i in range(self.len / itemsize):
9494  */
9495  __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
9496  if (__pyx_t_4) {
9497 
9498  /* "View.MemoryView":179
9499  *
9500  * if self.dtype_is_object:
9501  * p = <PyObject **> self.data # <<<<<<<<<<<<<<
9502  * for i in range(self.len / itemsize):
9503  * p[i] = Py_None
9504  */
9505  __pyx_v_p = ((PyObject **)__pyx_v_self->data);
9506 
9507  /* "View.MemoryView":180
9508  * if self.dtype_is_object:
9509  * p = <PyObject **> self.data
9510  * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
9511  * p[i] = Py_None
9512  * Py_INCREF(Py_None)
9513  */
9514  if (unlikely(__pyx_v_itemsize == 0)) {
9515  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
9516  __PYX_ERR(1, 180, __pyx_L1_error)
9517  }
9518  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
9519  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
9520  __PYX_ERR(1, 180, __pyx_L1_error)
9521  }
9522  __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
9523  __pyx_t_9 = __pyx_t_1;
9524  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
9525  __pyx_v_i = __pyx_t_11;
9526 
9527  /* "View.MemoryView":181
9528  * p = <PyObject **> self.data
9529  * for i in range(self.len / itemsize):
9530  * p[i] = Py_None # <<<<<<<<<<<<<<
9531  * Py_INCREF(Py_None)
9532  *
9533  */
9534  (__pyx_v_p[__pyx_v_i]) = Py_None;
9535 
9536  /* "View.MemoryView":182
9537  * for i in range(self.len / itemsize):
9538  * p[i] = Py_None
9539  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
9540  *
9541  * @cname('getbuffer')
9542  */
9543  Py_INCREF(Py_None);
9544  }
9545 
9546  /* "View.MemoryView":178
9547  * raise MemoryError("unable to allocate array data.")
9548  *
9549  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9550  * p = <PyObject **> self.data
9551  * for i in range(self.len / itemsize):
9552  */
9553  }
9554 
9555  /* "View.MemoryView":171
9556  * self.free_data = allocate_buffer
9557  * self.dtype_is_object = format == b'O'
9558  * if allocate_buffer: # <<<<<<<<<<<<<<
9559  *
9560  *
9561  */
9562  }
9563 
9564  /* "View.MemoryView":122
9565  * cdef bint dtype_is_object
9566  *
9567  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
9568  * mode="c", bint allocate_buffer=True):
9569  *
9570  */
9571 
9572  /* function exit code */
9573  __pyx_r = 0;
9574  goto __pyx_L0;
9575  __pyx_L1_error:;
9576  __Pyx_XDECREF(__pyx_t_3);
9577  __Pyx_XDECREF(__pyx_t_5);
9578  __Pyx_XDECREF(__pyx_t_6);
9579  __Pyx_XDECREF(__pyx_t_10);
9580  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9581  __pyx_r = -1;
9582  __pyx_L0:;
9583  __Pyx_XDECREF(__pyx_v_format);
9584  __Pyx_TraceReturn(Py_None, 0);
9585  __Pyx_RefNannyFinishContext();
9586  return __pyx_r;
9587 }
9588 
9589 /* "View.MemoryView":185
9590  *
9591  * @cname('getbuffer')
9592  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
9593  * cdef int bufmode = -1
9594  * if self.mode == u"c":
9595  */
9596 
9597 /* Python wrapper */
9598 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
9599 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
9600  int __pyx_r;
9601  __Pyx_RefNannyDeclarations
9602  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
9603  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
9604 
9605  /* function exit code */
9606  __Pyx_RefNannyFinishContext();
9607  return __pyx_r;
9608 }
9609 
9610 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
9611  int __pyx_v_bufmode;
9612  int __pyx_r;
9613  __Pyx_TraceDeclarations
9614  __Pyx_RefNannyDeclarations
9615  int __pyx_t_1;
9616  int __pyx_t_2;
9617  PyObject *__pyx_t_3 = NULL;
9618  char *__pyx_t_4;
9619  Py_ssize_t __pyx_t_5;
9620  int __pyx_t_6;
9621  Py_ssize_t *__pyx_t_7;
9622  if (__pyx_v_info == NULL) {
9623  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
9624  return -1;
9625  }
9626  __Pyx_RefNannySetupContext("__getbuffer__", 0);
9627  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
9628  __Pyx_GIVEREF(__pyx_v_info->obj);
9629  __Pyx_TraceCall("__getbuffer__", __pyx_f[1], 185, 0, __PYX_ERR(1, 185, __pyx_L1_error));
9630 
9631  /* "View.MemoryView":186
9632  * @cname('getbuffer')
9633  * def __getbuffer__(self, Py_buffer *info, int flags):
9634  * cdef int bufmode = -1 # <<<<<<<<<<<<<<
9635  * if self.mode == u"c":
9636  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9637  */
9638  __pyx_v_bufmode = -1;
9639 
9640  /* "View.MemoryView":187
9641  * def __getbuffer__(self, Py_buffer *info, int flags):
9642  * cdef int bufmode = -1
9643  * if self.mode == u"c": # <<<<<<<<<<<<<<
9644  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9645  * elif self.mode == u"fortran":
9646  */
9647  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
9648  __pyx_t_2 = (__pyx_t_1 != 0);
9649  if (__pyx_t_2) {
9650 
9651  /* "View.MemoryView":188
9652  * cdef int bufmode = -1
9653  * if self.mode == u"c":
9654  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
9655  * elif self.mode == u"fortran":
9656  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9657  */
9658  __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
9659 
9660  /* "View.MemoryView":187
9661  * def __getbuffer__(self, Py_buffer *info, int flags):
9662  * cdef int bufmode = -1
9663  * if self.mode == u"c": # <<<<<<<<<<<<<<
9664  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9665  * elif self.mode == u"fortran":
9666  */
9667  goto __pyx_L3;
9668  }
9669 
9670  /* "View.MemoryView":189
9671  * if self.mode == u"c":
9672  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9673  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
9674  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9675  * if not (flags & bufmode):
9676  */
9677  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 189, __pyx_L1_error)
9678  __pyx_t_1 = (__pyx_t_2 != 0);
9679  if (__pyx_t_1) {
9680 
9681  /* "View.MemoryView":190
9682  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9683  * elif self.mode == u"fortran":
9684  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
9685  * if not (flags & bufmode):
9686  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9687  */
9688  __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
9689 
9690  /* "View.MemoryView":189
9691  * if self.mode == u"c":
9692  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9693  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
9694  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9695  * if not (flags & bufmode):
9696  */
9697  }
9698  __pyx_L3:;
9699 
9700  /* "View.MemoryView":191
9701  * elif self.mode == u"fortran":
9702  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9703  * if not (flags & bufmode): # <<<<<<<<<<<<<<
9704  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9705  * info.buf = self.data
9706  */
9707  __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
9708  if (unlikely(__pyx_t_1)) {
9709 
9710  /* "View.MemoryView":192
9711  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9712  * if not (flags & bufmode):
9713  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
9714  * info.buf = self.data
9715  * info.len = self.len
9716  */
9717  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error)
9718  __Pyx_GOTREF(__pyx_t_3);
9719  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9720  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9721  __PYX_ERR(1, 192, __pyx_L1_error)
9722 
9723  /* "View.MemoryView":191
9724  * elif self.mode == u"fortran":
9725  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9726  * if not (flags & bufmode): # <<<<<<<<<<<<<<
9727  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9728  * info.buf = self.data
9729  */
9730  }
9731 
9732  /* "View.MemoryView":193
9733  * if not (flags & bufmode):
9734  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9735  * info.buf = self.data # <<<<<<<<<<<<<<
9736  * info.len = self.len
9737  * info.ndim = self.ndim
9738  */
9739  __pyx_t_4 = __pyx_v_self->data;
9740  __pyx_v_info->buf = __pyx_t_4;
9741 
9742  /* "View.MemoryView":194
9743  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9744  * info.buf = self.data
9745  * info.len = self.len # <<<<<<<<<<<<<<
9746  * info.ndim = self.ndim
9747  * info.shape = self._shape
9748  */
9749  __pyx_t_5 = __pyx_v_self->len;
9750  __pyx_v_info->len = __pyx_t_5;
9751 
9752  /* "View.MemoryView":195
9753  * info.buf = self.data
9754  * info.len = self.len
9755  * info.ndim = self.ndim # <<<<<<<<<<<<<<
9756  * info.shape = self._shape
9757  * info.strides = self._strides
9758  */
9759  __pyx_t_6 = __pyx_v_self->ndim;
9760  __pyx_v_info->ndim = __pyx_t_6;
9761 
9762  /* "View.MemoryView":196
9763  * info.len = self.len
9764  * info.ndim = self.ndim
9765  * info.shape = self._shape # <<<<<<<<<<<<<<
9766  * info.strides = self._strides
9767  * info.suboffsets = NULL
9768  */
9769  __pyx_t_7 = __pyx_v_self->_shape;
9770  __pyx_v_info->shape = __pyx_t_7;
9771 
9772  /* "View.MemoryView":197
9773  * info.ndim = self.ndim
9774  * info.shape = self._shape
9775  * info.strides = self._strides # <<<<<<<<<<<<<<
9776  * info.suboffsets = NULL
9777  * info.itemsize = self.itemsize
9778  */
9779  __pyx_t_7 = __pyx_v_self->_strides;
9780  __pyx_v_info->strides = __pyx_t_7;
9781 
9782  /* "View.MemoryView":198
9783  * info.shape = self._shape
9784  * info.strides = self._strides
9785  * info.suboffsets = NULL # <<<<<<<<<<<<<<
9786  * info.itemsize = self.itemsize
9787  * info.readonly = 0
9788  */
9789  __pyx_v_info->suboffsets = NULL;
9790 
9791  /* "View.MemoryView":199
9792  * info.strides = self._strides
9793  * info.suboffsets = NULL
9794  * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
9795  * info.readonly = 0
9796  *
9797  */
9798  __pyx_t_5 = __pyx_v_self->itemsize;
9799  __pyx_v_info->itemsize = __pyx_t_5;
9800 
9801  /* "View.MemoryView":200
9802  * info.suboffsets = NULL
9803  * info.itemsize = self.itemsize
9804  * info.readonly = 0 # <<<<<<<<<<<<<<
9805  *
9806  * if flags & PyBUF_FORMAT:
9807  */
9808  __pyx_v_info->readonly = 0;
9809 
9810  /* "View.MemoryView":202
9811  * info.readonly = 0
9812  *
9813  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9814  * info.format = self.format
9815  * else:
9816  */
9817  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
9818  if (__pyx_t_1) {
9819 
9820  /* "View.MemoryView":203
9821  *
9822  * if flags & PyBUF_FORMAT:
9823  * info.format = self.format # <<<<<<<<<<<<<<
9824  * else:
9825  * info.format = NULL
9826  */
9827  __pyx_t_4 = __pyx_v_self->format;
9828  __pyx_v_info->format = __pyx_t_4;
9829 
9830  /* "View.MemoryView":202
9831  * info.readonly = 0
9832  *
9833  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9834  * info.format = self.format
9835  * else:
9836  */
9837  goto __pyx_L5;
9838  }
9839 
9840  /* "View.MemoryView":205
9841  * info.format = self.format
9842  * else:
9843  * info.format = NULL # <<<<<<<<<<<<<<
9844  *
9845  * info.obj = self
9846  */
9847  /*else*/ {
9848  __pyx_v_info->format = NULL;
9849  }
9850  __pyx_L5:;
9851 
9852  /* "View.MemoryView":207
9853  * info.format = NULL
9854  *
9855  * info.obj = self # <<<<<<<<<<<<<<
9856  *
9857  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
9858  */
9859  __Pyx_INCREF(((PyObject *)__pyx_v_self));
9860  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9861  __Pyx_GOTREF(__pyx_v_info->obj);
9862  __Pyx_DECREF(__pyx_v_info->obj);
9863  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
9864 
9865  /* "View.MemoryView":185
9866  *
9867  * @cname('getbuffer')
9868  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
9869  * cdef int bufmode = -1
9870  * if self.mode == u"c":
9871  */
9872 
9873  /* function exit code */
9874  __pyx_r = 0;
9875  goto __pyx_L0;
9876  __pyx_L1_error:;
9877  __Pyx_XDECREF(__pyx_t_3);
9878  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9879  __pyx_r = -1;
9880  if (__pyx_v_info->obj != NULL) {
9881  __Pyx_GOTREF(__pyx_v_info->obj);
9882  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9883  }
9884  goto __pyx_L2;
9885  __pyx_L0:;
9886  if (__pyx_v_info->obj == Py_None) {
9887  __Pyx_GOTREF(__pyx_v_info->obj);
9888  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9889  }
9890  __pyx_L2:;
9891  __Pyx_TraceReturn(Py_None, 0);
9892  __Pyx_RefNannyFinishContext();
9893  return __pyx_r;
9894 }
9895 
9896 /* "View.MemoryView":211
9897  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
9898  *
9899  * def __dealloc__(array self): # <<<<<<<<<<<<<<
9900  * if self.callback_free_data != NULL:
9901  * self.callback_free_data(self.data)
9902  */
9903 
9904 /* Python wrapper */
9905 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
9906 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
9907  __Pyx_RefNannyDeclarations
9908  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
9909  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
9910 
9911  /* function exit code */
9912  __Pyx_RefNannyFinishContext();
9913 }
9914 
9915 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
9916  __Pyx_TraceDeclarations
9917  __Pyx_RefNannyDeclarations
9918  int __pyx_t_1;
9919  __Pyx_RefNannySetupContext("__dealloc__", 0);
9920  __Pyx_TraceCall("__dealloc__", __pyx_f[1], 211, 0, __PYX_ERR(1, 211, __pyx_L1_error));
9921 
9922  /* "View.MemoryView":212
9923  *
9924  * def __dealloc__(array self):
9925  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
9926  * self.callback_free_data(self.data)
9927  * elif self.free_data:
9928  */
9929  __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
9930  if (__pyx_t_1) {
9931 
9932  /* "View.MemoryView":213
9933  * def __dealloc__(array self):
9934  * if self.callback_free_data != NULL:
9935  * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
9936  * elif self.free_data:
9937  * if self.dtype_is_object:
9938  */
9939  __pyx_v_self->callback_free_data(__pyx_v_self->data);
9940 
9941  /* "View.MemoryView":212
9942  *
9943  * def __dealloc__(array self):
9944  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
9945  * self.callback_free_data(self.data)
9946  * elif self.free_data:
9947  */
9948  goto __pyx_L3;
9949  }
9950 
9951  /* "View.MemoryView":214
9952  * if self.callback_free_data != NULL:
9953  * self.callback_free_data(self.data)
9954  * elif self.free_data: # <<<<<<<<<<<<<<
9955  * if self.dtype_is_object:
9956  * refcount_objects_in_slice(self.data, self._shape,
9957  */
9958  __pyx_t_1 = (__pyx_v_self->free_data != 0);
9959  if (__pyx_t_1) {
9960 
9961  /* "View.MemoryView":215
9962  * self.callback_free_data(self.data)
9963  * elif self.free_data:
9964  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9965  * refcount_objects_in_slice(self.data, self._shape,
9966  * self._strides, self.ndim, False)
9967  */
9968  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
9969  if (__pyx_t_1) {
9970 
9971  /* "View.MemoryView":216
9972  * elif self.free_data:
9973  * if self.dtype_is_object:
9974  * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
9975  * self._strides, self.ndim, False)
9976  * free(self.data)
9977  */
9978  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
9979 
9980  /* "View.MemoryView":215
9981  * self.callback_free_data(self.data)
9982  * elif self.free_data:
9983  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9984  * refcount_objects_in_slice(self.data, self._shape,
9985  * self._strides, self.ndim, False)
9986  */
9987  }
9988 
9989  /* "View.MemoryView":218
9990  * refcount_objects_in_slice(self.data, self._shape,
9991  * self._strides, self.ndim, False)
9992  * free(self.data) # <<<<<<<<<<<<<<
9993  * PyObject_Free(self._shape)
9994  *
9995  */
9996  free(__pyx_v_self->data);
9997 
9998  /* "View.MemoryView":214
9999  * if self.callback_free_data != NULL:
10000  * self.callback_free_data(self.data)
10001  * elif self.free_data: # <<<<<<<<<<<<<<
10002  * if self.dtype_is_object:
10003  * refcount_objects_in_slice(self.data, self._shape,
10004  */
10005  }
10006  __pyx_L3:;
10007 
10008  /* "View.MemoryView":219
10009  * self._strides, self.ndim, False)
10010  * free(self.data)
10011  * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
10012  *
10013  * @property
10014  */
10015  PyObject_Free(__pyx_v_self->_shape);
10016 
10017  /* "View.MemoryView":211
10018  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
10019  *
10020  * def __dealloc__(array self): # <<<<<<<<<<<<<<
10021  * if self.callback_free_data != NULL:
10022  * self.callback_free_data(self.data)
10023  */
10024 
10025  /* function exit code */
10026  goto __pyx_L0;
10027  __pyx_L1_error:;
10028  __Pyx_WriteUnraisable("View.MemoryView.array.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
10029  __pyx_L0:;
10030  __Pyx_TraceReturn(Py_None, 0);
10031  __Pyx_RefNannyFinishContext();
10032 }
10033 
10034 /* "View.MemoryView":222
10035  *
10036  * @property
10037  * def memview(self): # <<<<<<<<<<<<<<
10038  * return self.get_memview()
10039  *
10040  */
10041 
10042 /* Python wrapper */
10043 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
10044 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
10045  PyObject *__pyx_r = 0;
10046  __Pyx_RefNannyDeclarations
10047  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10048  __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
10049 
10050  /* function exit code */
10051  __Pyx_RefNannyFinishContext();
10052  return __pyx_r;
10053 }
10054 
10055 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
10056  PyObject *__pyx_r = NULL;
10057  __Pyx_TraceDeclarations
10058  __Pyx_RefNannyDeclarations
10059  PyObject *__pyx_t_1 = NULL;
10060  __Pyx_RefNannySetupContext("__get__", 0);
10061  __Pyx_TraceCall("__get__", __pyx_f[1], 222, 0, __PYX_ERR(1, 222, __pyx_L1_error));
10062 
10063  /* "View.MemoryView":223
10064  * @property
10065  * def memview(self):
10066  * return self.get_memview() # <<<<<<<<<<<<<<
10067  *
10068  * @cname('get_memview')
10069  */
10070  __Pyx_XDECREF(__pyx_r);
10071  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error)
10072  __Pyx_GOTREF(__pyx_t_1);
10073  __pyx_r = __pyx_t_1;
10074  __pyx_t_1 = 0;
10075  goto __pyx_L0;
10076 
10077  /* "View.MemoryView":222
10078  *
10079  * @property
10080  * def memview(self): # <<<<<<<<<<<<<<
10081  * return self.get_memview()
10082  *
10083  */
10084 
10085  /* function exit code */
10086  __pyx_L1_error:;
10087  __Pyx_XDECREF(__pyx_t_1);
10088  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10089  __pyx_r = NULL;
10090  __pyx_L0:;
10091  __Pyx_XGIVEREF(__pyx_r);
10092  __Pyx_TraceReturn(__pyx_r, 0);
10093  __Pyx_RefNannyFinishContext();
10094  return __pyx_r;
10095 }
10096 
10097 /* "View.MemoryView":226
10098  *
10099  * @cname('get_memview')
10100  * cdef get_memview(self): # <<<<<<<<<<<<<<
10101  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
10102  * return memoryview(self, flags, self.dtype_is_object)
10103  */
10104 
10105 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
10106  int __pyx_v_flags;
10107  PyObject *__pyx_r = NULL;
10108  __Pyx_TraceDeclarations
10109  __Pyx_RefNannyDeclarations
10110  PyObject *__pyx_t_1 = NULL;
10111  PyObject *__pyx_t_2 = NULL;
10112  PyObject *__pyx_t_3 = NULL;
10113  __Pyx_RefNannySetupContext("get_memview", 0);
10114  __Pyx_TraceCall("get_memview", __pyx_f[1], 226, 0, __PYX_ERR(1, 226, __pyx_L1_error));
10115 
10116  /* "View.MemoryView":227
10117  * @cname('get_memview')
10118  * cdef get_memview(self):
10119  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
10120  * return memoryview(self, flags, self.dtype_is_object)
10121  *
10122  */
10123  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
10124 
10125  /* "View.MemoryView":228
10126  * cdef get_memview(self):
10127  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
10128  * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
10129  *
10130  * def __len__(self):
10131  */
10132  __Pyx_XDECREF(__pyx_r);
10133  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error)
10134  __Pyx_GOTREF(__pyx_t_1);
10135  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
10136  __Pyx_GOTREF(__pyx_t_2);
10137  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error)
10138  __Pyx_GOTREF(__pyx_t_3);
10139  __Pyx_INCREF(((PyObject *)__pyx_v_self));
10140  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
10141  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
10142  __Pyx_GIVEREF(__pyx_t_1);
10143  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
10144  __Pyx_GIVEREF(__pyx_t_2);
10145  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
10146  __pyx_t_1 = 0;
10147  __pyx_t_2 = 0;
10148  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
10149  __Pyx_GOTREF(__pyx_t_2);
10150  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10151  __pyx_r = __pyx_t_2;
10152  __pyx_t_2 = 0;
10153  goto __pyx_L0;
10154 
10155  /* "View.MemoryView":226
10156  *
10157  * @cname('get_memview')
10158  * cdef get_memview(self): # <<<<<<<<<<<<<<
10159  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
10160  * return memoryview(self, flags, self.dtype_is_object)
10161  */
10162 
10163  /* function exit code */
10164  __pyx_L1_error:;
10165  __Pyx_XDECREF(__pyx_t_1);
10166  __Pyx_XDECREF(__pyx_t_2);
10167  __Pyx_XDECREF(__pyx_t_3);
10168  __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
10169  __pyx_r = 0;
10170  __pyx_L0:;
10171  __Pyx_XGIVEREF(__pyx_r);
10172  __Pyx_TraceReturn(__pyx_r, 0);
10173  __Pyx_RefNannyFinishContext();
10174  return __pyx_r;
10175 }
10176 
10177 /* "View.MemoryView":230
10178  * return memoryview(self, flags, self.dtype_is_object)
10179  *
10180  * def __len__(self): # <<<<<<<<<<<<<<
10181  * return self._shape[0]
10182  *
10183  */
10184 
10185 /* Python wrapper */
10186 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
10187 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
10188  Py_ssize_t __pyx_r;
10189  __Pyx_RefNannyDeclarations
10190  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
10191  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
10192 
10193  /* function exit code */
10194  __Pyx_RefNannyFinishContext();
10195  return __pyx_r;
10196 }
10197 
10198 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
10199  Py_ssize_t __pyx_r;
10200  __Pyx_TraceDeclarations
10201  __Pyx_RefNannyDeclarations
10202  __Pyx_RefNannySetupContext("__len__", 0);
10203  __Pyx_TraceCall("__len__", __pyx_f[1], 230, 0, __PYX_ERR(1, 230, __pyx_L1_error));
10204 
10205  /* "View.MemoryView":231
10206  *
10207  * def __len__(self):
10208  * return self._shape[0] # <<<<<<<<<<<<<<
10209  *
10210  * def __getattr__(self, attr):
10211  */
10212  __pyx_r = (__pyx_v_self->_shape[0]);
10213  goto __pyx_L0;
10214 
10215  /* "View.MemoryView":230
10216  * return memoryview(self, flags, self.dtype_is_object)
10217  *
10218  * def __len__(self): # <<<<<<<<<<<<<<
10219  * return self._shape[0]
10220  *
10221  */
10222 
10223  /* function exit code */
10224  __pyx_L1_error:;
10225  __Pyx_AddTraceback("View.MemoryView.array.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10226  __pyx_r = -1;
10227  __pyx_L0:;
10228  __Pyx_TraceReturn(Py_None, 0);
10229  __Pyx_RefNannyFinishContext();
10230  return __pyx_r;
10231 }
10232 
10233 /* "View.MemoryView":233
10234  * return self._shape[0]
10235  *
10236  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
10237  * return getattr(self.memview, attr)
10238  *
10239  */
10240 
10241 /* Python wrapper */
10242 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
10243 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
10244  PyObject *__pyx_r = 0;
10245  __Pyx_RefNannyDeclarations
10246  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
10247  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
10248 
10249  /* function exit code */
10250  __Pyx_RefNannyFinishContext();
10251  return __pyx_r;
10252 }
10253 
10254 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
10255  PyObject *__pyx_r = NULL;
10256  __Pyx_TraceDeclarations
10257  __Pyx_RefNannyDeclarations
10258  PyObject *__pyx_t_1 = NULL;
10259  PyObject *__pyx_t_2 = NULL;
10260  __Pyx_RefNannySetupContext("__getattr__", 0);
10261  __Pyx_TraceCall("__getattr__", __pyx_f[1], 233, 0, __PYX_ERR(1, 233, __pyx_L1_error));
10262 
10263  /* "View.MemoryView":234
10264  *
10265  * def __getattr__(self, attr):
10266  * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
10267  *
10268  * def __getitem__(self, item):
10269  */
10270  __Pyx_XDECREF(__pyx_r);
10271  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error)
10272  __Pyx_GOTREF(__pyx_t_1);
10273  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error)
10274  __Pyx_GOTREF(__pyx_t_2);
10275  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10276  __pyx_r = __pyx_t_2;
10277  __pyx_t_2 = 0;
10278  goto __pyx_L0;
10279 
10280  /* "View.MemoryView":233
10281  * return self._shape[0]
10282  *
10283  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
10284  * return getattr(self.memview, attr)
10285  *
10286  */
10287 
10288  /* function exit code */
10289  __pyx_L1_error:;
10290  __Pyx_XDECREF(__pyx_t_1);
10291  __Pyx_XDECREF(__pyx_t_2);
10292  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10293  __pyx_r = NULL;
10294  __pyx_L0:;
10295  __Pyx_XGIVEREF(__pyx_r);
10296  __Pyx_TraceReturn(__pyx_r, 0);
10297  __Pyx_RefNannyFinishContext();
10298  return __pyx_r;
10299 }
10300 
10301 /* "View.MemoryView":236
10302  * return getattr(self.memview, attr)
10303  *
10304  * def __getitem__(self, item): # <<<<<<<<<<<<<<
10305  * return self.memview[item]
10306  *
10307  */
10308 
10309 /* Python wrapper */
10310 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
10311 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
10312  PyObject *__pyx_r = 0;
10313  __Pyx_RefNannyDeclarations
10314  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
10315  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
10316 
10317  /* function exit code */
10318  __Pyx_RefNannyFinishContext();
10319  return __pyx_r;
10320 }
10321 
10322 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
10323  PyObject *__pyx_r = NULL;
10324  __Pyx_TraceDeclarations
10325  __Pyx_RefNannyDeclarations
10326  PyObject *__pyx_t_1 = NULL;
10327  PyObject *__pyx_t_2 = NULL;
10328  __Pyx_RefNannySetupContext("__getitem__", 0);
10329  __Pyx_TraceCall("__getitem__", __pyx_f[1], 236, 0, __PYX_ERR(1, 236, __pyx_L1_error));
10330 
10331  /* "View.MemoryView":237
10332  *
10333  * def __getitem__(self, item):
10334  * return self.memview[item] # <<<<<<<<<<<<<<
10335  *
10336  * def __setitem__(self, item, value):
10337  */
10338  __Pyx_XDECREF(__pyx_r);
10339  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
10340  __Pyx_GOTREF(__pyx_t_1);
10341  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error)
10342  __Pyx_GOTREF(__pyx_t_2);
10343  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10344  __pyx_r = __pyx_t_2;
10345  __pyx_t_2 = 0;
10346  goto __pyx_L0;
10347 
10348  /* "View.MemoryView":236
10349  * return getattr(self.memview, attr)
10350  *
10351  * def __getitem__(self, item): # <<<<<<<<<<<<<<
10352  * return self.memview[item]
10353  *
10354  */
10355 
10356  /* function exit code */
10357  __pyx_L1_error:;
10358  __Pyx_XDECREF(__pyx_t_1);
10359  __Pyx_XDECREF(__pyx_t_2);
10360  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10361  __pyx_r = NULL;
10362  __pyx_L0:;
10363  __Pyx_XGIVEREF(__pyx_r);
10364  __Pyx_TraceReturn(__pyx_r, 0);
10365  __Pyx_RefNannyFinishContext();
10366  return __pyx_r;
10367 }
10368 
10369 /* "View.MemoryView":239
10370  * return self.memview[item]
10371  *
10372  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
10373  * self.memview[item] = value
10374  *
10375  */
10376 
10377 /* Python wrapper */
10378 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
10379 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
10380  int __pyx_r;
10381  __Pyx_RefNannyDeclarations
10382  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
10383  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
10384 
10385  /* function exit code */
10386  __Pyx_RefNannyFinishContext();
10387  return __pyx_r;
10388 }
10389 
10390 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
10391  int __pyx_r;
10392  __Pyx_TraceDeclarations
10393  __Pyx_RefNannyDeclarations
10394  PyObject *__pyx_t_1 = NULL;
10395  __Pyx_RefNannySetupContext("__setitem__", 0);
10396  __Pyx_TraceCall("__setitem__", __pyx_f[1], 239, 0, __PYX_ERR(1, 239, __pyx_L1_error));
10397 
10398  /* "View.MemoryView":240
10399  *
10400  * def __setitem__(self, item, value):
10401  * self.memview[item] = value # <<<<<<<<<<<<<<
10402  *
10403  *
10404  */
10405  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
10406  __Pyx_GOTREF(__pyx_t_1);
10407  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 240, __pyx_L1_error)
10408  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10409 
10410  /* "View.MemoryView":239
10411  * return self.memview[item]
10412  *
10413  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
10414  * self.memview[item] = value
10415  *
10416  */
10417 
10418  /* function exit code */
10419  __pyx_r = 0;
10420  goto __pyx_L0;
10421  __pyx_L1_error:;
10422  __Pyx_XDECREF(__pyx_t_1);
10423  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10424  __pyx_r = -1;
10425  __pyx_L0:;
10426  __Pyx_TraceReturn(Py_None, 0);
10427  __Pyx_RefNannyFinishContext();
10428  return __pyx_r;
10429 }
10430 
10431 /* "(tree fragment)":1
10432  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10433  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10434  * def __setstate_cython__(self, __pyx_state):
10435  */
10436 
10437 /* Python wrapper */
10438 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
10439 static PyMethodDef __pyx_mdef___pyx_array_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0};
10440 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10441  PyObject *__pyx_r = 0;
10442  __Pyx_RefNannyDeclarations
10443  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
10444  __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
10445 
10446  /* function exit code */
10447  __Pyx_RefNannyFinishContext();
10448  return __pyx_r;
10449 }
10450 
10451 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
10452  PyObject *__pyx_r = NULL;
10453  __Pyx_TraceDeclarations
10454  __Pyx_RefNannyDeclarations
10455  PyObject *__pyx_t_1 = NULL;
10456  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
10457  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
10458 
10459  /* "(tree fragment)":2
10460  * def __reduce_cython__(self):
10461  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
10462  * def __setstate_cython__(self, __pyx_state):
10463  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10464  */
10465  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
10466  __Pyx_GOTREF(__pyx_t_1);
10467  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10468  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10469  __PYX_ERR(1, 2, __pyx_L1_error)
10470 
10471  /* "(tree fragment)":1
10472  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10473  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10474  * def __setstate_cython__(self, __pyx_state):
10475  */
10476 
10477  /* function exit code */
10478  __pyx_L1_error:;
10479  __Pyx_XDECREF(__pyx_t_1);
10480  __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10481  __pyx_r = NULL;
10482  __Pyx_XGIVEREF(__pyx_r);
10483  __Pyx_TraceReturn(__pyx_r, 0);
10484  __Pyx_RefNannyFinishContext();
10485  return __pyx_r;
10486 }
10487 
10488 /* "(tree fragment)":3
10489  * def __reduce_cython__(self):
10490  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10491  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10492  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10493  */
10494 
10495 /* Python wrapper */
10496 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
10497 static PyMethodDef __pyx_mdef___pyx_array_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0};
10498 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10499  PyObject *__pyx_r = 0;
10500  __Pyx_RefNannyDeclarations
10501  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
10502  __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10503 
10504  /* function exit code */
10505  __Pyx_RefNannyFinishContext();
10506  return __pyx_r;
10507 }
10508 
10509 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
10510  PyObject *__pyx_r = NULL;
10511  __Pyx_TraceDeclarations
10512  __Pyx_RefNannyDeclarations
10513  PyObject *__pyx_t_1 = NULL;
10514  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
10515  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
10516 
10517  /* "(tree fragment)":4
10518  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10519  * def __setstate_cython__(self, __pyx_state):
10520  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
10521  */
10522  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
10523  __Pyx_GOTREF(__pyx_t_1);
10524  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10525  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10526  __PYX_ERR(1, 4, __pyx_L1_error)
10527 
10528  /* "(tree fragment)":3
10529  * def __reduce_cython__(self):
10530  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10531  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10532  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10533  */
10534 
10535  /* function exit code */
10536  __pyx_L1_error:;
10537  __Pyx_XDECREF(__pyx_t_1);
10538  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10539  __pyx_r = NULL;
10540  __Pyx_XGIVEREF(__pyx_r);
10541  __Pyx_TraceReturn(__pyx_r, 0);
10542  __Pyx_RefNannyFinishContext();
10543  return __pyx_r;
10544 }
10545 
10546 /* "View.MemoryView":244
10547  *
10548  * @cname("__pyx_array_new")
10549  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
10550  * char *mode, char *buf):
10551  * cdef array result
10552  */
10553 
10554 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
10555  struct __pyx_array_obj *__pyx_v_result = 0;
10556  struct __pyx_array_obj *__pyx_r = NULL;
10557  __Pyx_TraceDeclarations
10558  __Pyx_RefNannyDeclarations
10559  int __pyx_t_1;
10560  PyObject *__pyx_t_2 = NULL;
10561  PyObject *__pyx_t_3 = NULL;
10562  PyObject *__pyx_t_4 = NULL;
10563  PyObject *__pyx_t_5 = NULL;
10564  __Pyx_RefNannySetupContext("array_cwrapper", 0);
10565  __Pyx_TraceCall("array_cwrapper", __pyx_f[1], 244, 0, __PYX_ERR(1, 244, __pyx_L1_error));
10566 
10567  /* "View.MemoryView":248
10568  * cdef array result
10569  *
10570  * if buf == NULL: # <<<<<<<<<<<<<<
10571  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10572  * else:
10573  */
10574  __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
10575  if (__pyx_t_1) {
10576 
10577  /* "View.MemoryView":249
10578  *
10579  * if buf == NULL:
10580  * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
10581  * else:
10582  * result = array(shape, itemsize, format, mode.decode('ASCII'),
10583  */
10584  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
10585  __Pyx_GOTREF(__pyx_t_2);
10586  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
10587  __Pyx_GOTREF(__pyx_t_3);
10588  __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
10589  __Pyx_GOTREF(__pyx_t_4);
10590  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 249, __pyx_L1_error)
10591  __Pyx_GOTREF(__pyx_t_5);
10592  __Pyx_INCREF(__pyx_v_shape);
10593  __Pyx_GIVEREF(__pyx_v_shape);
10594  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
10595  __Pyx_GIVEREF(__pyx_t_2);
10596  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
10597  __Pyx_GIVEREF(__pyx_t_3);
10598  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
10599  __Pyx_GIVEREF(__pyx_t_4);
10600  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
10601  __pyx_t_2 = 0;
10602  __pyx_t_3 = 0;
10603  __pyx_t_4 = 0;
10604  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
10605  __Pyx_GOTREF(__pyx_t_4);
10606  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10607  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
10608  __pyx_t_4 = 0;
10609 
10610  /* "View.MemoryView":248
10611  * cdef array result
10612  *
10613  * if buf == NULL: # <<<<<<<<<<<<<<
10614  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10615  * else:
10616  */
10617  goto __pyx_L3;
10618  }
10619 
10620  /* "View.MemoryView":251
10621  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10622  * else:
10623  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
10624  * allocate_buffer=False)
10625  * result.data = buf
10626  */
10627  /*else*/ {
10628  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error)
10629  __Pyx_GOTREF(__pyx_t_4);
10630  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
10631  __Pyx_GOTREF(__pyx_t_5);
10632  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error)
10633  __Pyx_GOTREF(__pyx_t_3);
10634  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error)
10635  __Pyx_GOTREF(__pyx_t_2);
10636  __Pyx_INCREF(__pyx_v_shape);
10637  __Pyx_GIVEREF(__pyx_v_shape);
10638  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
10639  __Pyx_GIVEREF(__pyx_t_4);
10640  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
10641  __Pyx_GIVEREF(__pyx_t_5);
10642  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
10643  __Pyx_GIVEREF(__pyx_t_3);
10644  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
10645  __pyx_t_4 = 0;
10646  __pyx_t_5 = 0;
10647  __pyx_t_3 = 0;
10648 
10649  /* "View.MemoryView":252
10650  * else:
10651  * result = array(shape, itemsize, format, mode.decode('ASCII'),
10652  * allocate_buffer=False) # <<<<<<<<<<<<<<
10653  * result.data = buf
10654  *
10655  */
10656  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
10657  __Pyx_GOTREF(__pyx_t_3);
10658  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 252, __pyx_L1_error)
10659 
10660  /* "View.MemoryView":251
10661  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10662  * else:
10663  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
10664  * allocate_buffer=False)
10665  * result.data = buf
10666  */
10667  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
10668  __Pyx_GOTREF(__pyx_t_5);
10669  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10670  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10671  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
10672  __pyx_t_5 = 0;
10673 
10674  /* "View.MemoryView":253
10675  * result = array(shape, itemsize, format, mode.decode('ASCII'),
10676  * allocate_buffer=False)
10677  * result.data = buf # <<<<<<<<<<<<<<
10678  *
10679  * return result
10680  */
10681  __pyx_v_result->data = __pyx_v_buf;
10682  }
10683  __pyx_L3:;
10684 
10685  /* "View.MemoryView":255
10686  * result.data = buf
10687  *
10688  * return result # <<<<<<<<<<<<<<
10689  *
10690  *
10691  */
10692  __Pyx_XDECREF(((PyObject *)__pyx_r));
10693  __Pyx_INCREF(((PyObject *)__pyx_v_result));
10694  __pyx_r = __pyx_v_result;
10695  goto __pyx_L0;
10696 
10697  /* "View.MemoryView":244
10698  *
10699  * @cname("__pyx_array_new")
10700  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
10701  * char *mode, char *buf):
10702  * cdef array result
10703  */
10704 
10705  /* function exit code */
10706  __pyx_L1_error:;
10707  __Pyx_XDECREF(__pyx_t_2);
10708  __Pyx_XDECREF(__pyx_t_3);
10709  __Pyx_XDECREF(__pyx_t_4);
10710  __Pyx_XDECREF(__pyx_t_5);
10711  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
10712  __pyx_r = 0;
10713  __pyx_L0:;
10714  __Pyx_XDECREF((PyObject *)__pyx_v_result);
10715  __Pyx_XGIVEREF((PyObject *)__pyx_r);
10716  __Pyx_TraceReturn(__pyx_r, 0);
10717  __Pyx_RefNannyFinishContext();
10718  return __pyx_r;
10719 }
10720 
10721 /* "View.MemoryView":281
10722  * cdef class Enum(object):
10723  * cdef object name
10724  * def __init__(self, name): # <<<<<<<<<<<<<<
10725  * self.name = name
10726  * def __repr__(self):
10727  */
10728 
10729 /* Python wrapper */
10730 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10731 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10732  PyObject *__pyx_v_name = 0;
10733  int __pyx_r;
10734  __Pyx_RefNannyDeclarations
10735  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
10736  {
10737  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
10738  PyObject* values[1] = {0};
10739  if (unlikely(__pyx_kwds)) {
10740  Py_ssize_t kw_args;
10741  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10742  switch (pos_args) {
10743  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10744  CYTHON_FALLTHROUGH;
10745  case 0: break;
10746  default: goto __pyx_L5_argtuple_error;
10747  }
10748  kw_args = PyDict_Size(__pyx_kwds);
10749  switch (pos_args) {
10750  case 0:
10751  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
10752  else goto __pyx_L5_argtuple_error;
10753  }
10754  if (unlikely(kw_args > 0)) {
10755  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error)
10756  }
10757  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
10758  goto __pyx_L5_argtuple_error;
10759  } else {
10760  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10761  }
10762  __pyx_v_name = values[0];
10763  }
10764  goto __pyx_L4_argument_unpacking_done;
10765  __pyx_L5_argtuple_error:;
10766  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error)
10767  __pyx_L3_error:;
10768  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10769  __Pyx_RefNannyFinishContext();
10770  return -1;
10771  __pyx_L4_argument_unpacking_done:;
10772  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
10773 
10774  /* function exit code */
10775  __Pyx_RefNannyFinishContext();
10776  return __pyx_r;
10777 }
10778 
10779 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
10780  int __pyx_r;
10781  __Pyx_TraceDeclarations
10782  __Pyx_RefNannyDeclarations
10783  __Pyx_RefNannySetupContext("__init__", 0);
10784  __Pyx_TraceCall("__init__", __pyx_f[1], 281, 0, __PYX_ERR(1, 281, __pyx_L1_error));
10785 
10786  /* "View.MemoryView":282
10787  * cdef object name
10788  * def __init__(self, name):
10789  * self.name = name # <<<<<<<<<<<<<<
10790  * def __repr__(self):
10791  * return self.name
10792  */
10793  __Pyx_INCREF(__pyx_v_name);
10794  __Pyx_GIVEREF(__pyx_v_name);
10795  __Pyx_GOTREF(__pyx_v_self->name);
10796  __Pyx_DECREF(__pyx_v_self->name);
10797  __pyx_v_self->name = __pyx_v_name;
10798 
10799  /* "View.MemoryView":281
10800  * cdef class Enum(object):
10801  * cdef object name
10802  * def __init__(self, name): # <<<<<<<<<<<<<<
10803  * self.name = name
10804  * def __repr__(self):
10805  */
10806 
10807  /* function exit code */
10808  __pyx_r = 0;
10809  goto __pyx_L0;
10810  __pyx_L1_error:;
10811  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10812  __pyx_r = -1;
10813  __pyx_L0:;
10814  __Pyx_TraceReturn(Py_None, 0);
10815  __Pyx_RefNannyFinishContext();
10816  return __pyx_r;
10817 }
10818 
10819 /* "View.MemoryView":283
10820  * def __init__(self, name):
10821  * self.name = name
10822  * def __repr__(self): # <<<<<<<<<<<<<<
10823  * return self.name
10824  *
10825  */
10826 
10827 /* Python wrapper */
10828 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
10829 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
10830  PyObject *__pyx_r = 0;
10831  __Pyx_RefNannyDeclarations
10832  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
10833  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10834 
10835  /* function exit code */
10836  __Pyx_RefNannyFinishContext();
10837  return __pyx_r;
10838 }
10839 
10840 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10841  PyObject *__pyx_r = NULL;
10842  __Pyx_TraceDeclarations
10843  __Pyx_RefNannyDeclarations
10844  __Pyx_RefNannySetupContext("__repr__", 0);
10845  __Pyx_TraceCall("__repr__", __pyx_f[1], 283, 0, __PYX_ERR(1, 283, __pyx_L1_error));
10846 
10847  /* "View.MemoryView":284
10848  * self.name = name
10849  * def __repr__(self):
10850  * return self.name # <<<<<<<<<<<<<<
10851  *
10852  * cdef generic = Enum("<strided and direct or indirect>")
10853  */
10854  __Pyx_XDECREF(__pyx_r);
10855  __Pyx_INCREF(__pyx_v_self->name);
10856  __pyx_r = __pyx_v_self->name;
10857  goto __pyx_L0;
10858 
10859  /* "View.MemoryView":283
10860  * def __init__(self, name):
10861  * self.name = name
10862  * def __repr__(self): # <<<<<<<<<<<<<<
10863  * return self.name
10864  *
10865  */
10866 
10867  /* function exit code */
10868  __pyx_L1_error:;
10869  __Pyx_AddTraceback("View.MemoryView.Enum.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10870  __pyx_r = NULL;
10871  __pyx_L0:;
10872  __Pyx_XGIVEREF(__pyx_r);
10873  __Pyx_TraceReturn(__pyx_r, 0);
10874  __Pyx_RefNannyFinishContext();
10875  return __pyx_r;
10876 }
10877 
10878 /* "(tree fragment)":1
10879  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10880  * cdef tuple state
10881  * cdef object _dict
10882  */
10883 
10884 /* Python wrapper */
10885 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
10886 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0};
10887 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10888  PyObject *__pyx_r = 0;
10889  __Pyx_RefNannyDeclarations
10890  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
10891  __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10892 
10893  /* function exit code */
10894  __Pyx_RefNannyFinishContext();
10895  return __pyx_r;
10896 }
10897 
10898 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10899  PyObject *__pyx_v_state = 0;
10900  PyObject *__pyx_v__dict = 0;
10901  int __pyx_v_use_setstate;
10902  PyObject *__pyx_r = NULL;
10903  __Pyx_TraceDeclarations
10904  __Pyx_RefNannyDeclarations
10905  PyObject *__pyx_t_1 = NULL;
10906  int __pyx_t_2;
10907  int __pyx_t_3;
10908  PyObject *__pyx_t_4 = NULL;
10909  PyObject *__pyx_t_5 = NULL;
10910  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
10911  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
10912 
10913  /* "(tree fragment)":5
10914  * cdef object _dict
10915  * cdef bint use_setstate
10916  * state = (self.name,) # <<<<<<<<<<<<<<
10917  * _dict = getattr(self, '__dict__', None)
10918  * if _dict is not None:
10919  */
10920  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
10921  __Pyx_GOTREF(__pyx_t_1);
10922  __Pyx_INCREF(__pyx_v_self->name);
10923  __Pyx_GIVEREF(__pyx_v_self->name);
10924  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
10925  __pyx_v_state = ((PyObject*)__pyx_t_1);
10926  __pyx_t_1 = 0;
10927 
10928  /* "(tree fragment)":6
10929  * cdef bint use_setstate
10930  * state = (self.name,)
10931  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
10932  * if _dict is not None:
10933  * state += (_dict,)
10934  */
10935  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
10936  __Pyx_GOTREF(__pyx_t_1);
10937  __pyx_v__dict = __pyx_t_1;
10938  __pyx_t_1 = 0;
10939 
10940  /* "(tree fragment)":7
10941  * state = (self.name,)
10942  * _dict = getattr(self, '__dict__', None)
10943  * if _dict is not None: # <<<<<<<<<<<<<<
10944  * state += (_dict,)
10945  * use_setstate = True
10946  */
10947  __pyx_t_2 = (__pyx_v__dict != Py_None);
10948  __pyx_t_3 = (__pyx_t_2 != 0);
10949  if (__pyx_t_3) {
10950 
10951  /* "(tree fragment)":8
10952  * _dict = getattr(self, '__dict__', None)
10953  * if _dict is not None:
10954  * state += (_dict,) # <<<<<<<<<<<<<<
10955  * use_setstate = True
10956  * else:
10957  */
10958  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
10959  __Pyx_GOTREF(__pyx_t_1);
10960  __Pyx_INCREF(__pyx_v__dict);
10961  __Pyx_GIVEREF(__pyx_v__dict);
10962  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
10963  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
10964  __Pyx_GOTREF(__pyx_t_4);
10965  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10966  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
10967  __pyx_t_4 = 0;
10968 
10969  /* "(tree fragment)":9
10970  * if _dict is not None:
10971  * state += (_dict,)
10972  * use_setstate = True # <<<<<<<<<<<<<<
10973  * else:
10974  * use_setstate = self.name is not None
10975  */
10976  __pyx_v_use_setstate = 1;
10977 
10978  /* "(tree fragment)":7
10979  * state = (self.name,)
10980  * _dict = getattr(self, '__dict__', None)
10981  * if _dict is not None: # <<<<<<<<<<<<<<
10982  * state += (_dict,)
10983  * use_setstate = True
10984  */
10985  goto __pyx_L3;
10986  }
10987 
10988  /* "(tree fragment)":11
10989  * use_setstate = True
10990  * else:
10991  * use_setstate = self.name is not None # <<<<<<<<<<<<<<
10992  * if use_setstate:
10993  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10994  */
10995  /*else*/ {
10996  __pyx_t_3 = (__pyx_v_self->name != Py_None);
10997  __pyx_v_use_setstate = __pyx_t_3;
10998  }
10999  __pyx_L3:;
11000 
11001  /* "(tree fragment)":12
11002  * else:
11003  * use_setstate = self.name is not None
11004  * if use_setstate: # <<<<<<<<<<<<<<
11005  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
11006  * else:
11007  */
11008  __pyx_t_3 = (__pyx_v_use_setstate != 0);
11009  if (__pyx_t_3) {
11010 
11011  /* "(tree fragment)":13
11012  * use_setstate = self.name is not None
11013  * if use_setstate:
11014  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
11015  * else:
11016  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
11017  */
11018  __Pyx_XDECREF(__pyx_r);
11019  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
11020  __Pyx_GOTREF(__pyx_t_4);
11021  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
11022  __Pyx_GOTREF(__pyx_t_1);
11023  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11024  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11025  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11026  __Pyx_INCREF(__pyx_int_184977713);
11027  __Pyx_GIVEREF(__pyx_int_184977713);
11028  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
11029  __Pyx_INCREF(Py_None);
11030  __Pyx_GIVEREF(Py_None);
11031  PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
11032  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
11033  __Pyx_GOTREF(__pyx_t_5);
11034  __Pyx_GIVEREF(__pyx_t_4);
11035  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
11036  __Pyx_GIVEREF(__pyx_t_1);
11037  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
11038  __Pyx_INCREF(__pyx_v_state);
11039  __Pyx_GIVEREF(__pyx_v_state);
11040  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
11041  __pyx_t_4 = 0;
11042  __pyx_t_1 = 0;
11043  __pyx_r = __pyx_t_5;
11044  __pyx_t_5 = 0;
11045  goto __pyx_L0;
11046 
11047  /* "(tree fragment)":12
11048  * else:
11049  * use_setstate = self.name is not None
11050  * if use_setstate: # <<<<<<<<<<<<<<
11051  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
11052  * else:
11053  */
11054  }
11055 
11056  /* "(tree fragment)":15
11057  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
11058  * else:
11059  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
11060  * def __setstate_cython__(self, __pyx_state):
11061  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
11062  */
11063  /*else*/ {
11064  __Pyx_XDECREF(__pyx_r);
11065  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
11066  __Pyx_GOTREF(__pyx_t_5);
11067  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
11068  __Pyx_GOTREF(__pyx_t_1);
11069  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11070  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11071  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11072  __Pyx_INCREF(__pyx_int_184977713);
11073  __Pyx_GIVEREF(__pyx_int_184977713);
11074  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
11075  __Pyx_INCREF(__pyx_v_state);
11076  __Pyx_GIVEREF(__pyx_v_state);
11077  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
11078  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
11079  __Pyx_GOTREF(__pyx_t_4);
11080  __Pyx_GIVEREF(__pyx_t_5);
11081  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
11082  __Pyx_GIVEREF(__pyx_t_1);
11083  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
11084  __pyx_t_5 = 0;
11085  __pyx_t_1 = 0;
11086  __pyx_r = __pyx_t_4;
11087  __pyx_t_4 = 0;
11088  goto __pyx_L0;
11089  }
11090 
11091  /* "(tree fragment)":1
11092  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
11093  * cdef tuple state
11094  * cdef object _dict
11095  */
11096 
11097  /* function exit code */
11098  __pyx_L1_error:;
11099  __Pyx_XDECREF(__pyx_t_1);
11100  __Pyx_XDECREF(__pyx_t_4);
11101  __Pyx_XDECREF(__pyx_t_5);
11102  __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11103  __pyx_r = NULL;
11104  __pyx_L0:;
11105  __Pyx_XDECREF(__pyx_v_state);
11106  __Pyx_XDECREF(__pyx_v__dict);
11107  __Pyx_XGIVEREF(__pyx_r);
11108  __Pyx_TraceReturn(__pyx_r, 0);
11109  __Pyx_RefNannyFinishContext();
11110  return __pyx_r;
11111 }
11112 
11113 /* "(tree fragment)":16
11114  * else:
11115  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
11116  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
11117  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
11118  */
11119 
11120 /* Python wrapper */
11121 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
11122 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0};
11123 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11124  PyObject *__pyx_r = 0;
11125  __Pyx_RefNannyDeclarations
11126  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
11127  __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
11128 
11129  /* function exit code */
11130  __Pyx_RefNannyFinishContext();
11131  return __pyx_r;
11132 }
11133 
11134 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11135  PyObject *__pyx_r = NULL;
11136  __Pyx_TraceDeclarations
11137  __Pyx_RefNannyDeclarations
11138  PyObject *__pyx_t_1 = NULL;
11139  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
11140  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error));
11141 
11142  /* "(tree fragment)":17
11143  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
11144  * def __setstate_cython__(self, __pyx_state):
11145  * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
11146  */
11147  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
11148  __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
11149  __Pyx_GOTREF(__pyx_t_1);
11150  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11151 
11152  /* "(tree fragment)":16
11153  * else:
11154  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
11155  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
11156  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
11157  */
11158 
11159  /* function exit code */
11160  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11161  goto __pyx_L0;
11162  __pyx_L1_error:;
11163  __Pyx_XDECREF(__pyx_t_1);
11164  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11165  __pyx_r = NULL;
11166  __pyx_L0:;
11167  __Pyx_XGIVEREF(__pyx_r);
11168  __Pyx_TraceReturn(__pyx_r, 0);
11169  __Pyx_RefNannyFinishContext();
11170  return __pyx_r;
11171 }
11172 
11173 /* "View.MemoryView":298
11174  *
11175  * @cname('__pyx_align_pointer')
11176  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
11177  * "Align pointer memory on a given boundary"
11178  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
11179  */
11180 
11181 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
11182  Py_intptr_t __pyx_v_aligned_p;
11183  size_t __pyx_v_offset;
11184  void *__pyx_r;
11185  __Pyx_TraceDeclarations
11186  int __pyx_t_1;
11187  __Pyx_TraceCall("align_pointer", __pyx_f[1], 298, 1, __PYX_ERR(1, 298, __pyx_L1_error));
11188 
11189  /* "View.MemoryView":300
11190  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
11191  * "Align pointer memory on a given boundary"
11192  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
11193  * cdef size_t offset
11194  *
11195  */
11196  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
11197 
11198  /* "View.MemoryView":304
11199  *
11200  * with cython.cdivision(True):
11201  * offset = aligned_p % alignment # <<<<<<<<<<<<<<
11202  *
11203  * if offset > 0:
11204  */
11205  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
11206 
11207  /* "View.MemoryView":306
11208  * offset = aligned_p % alignment
11209  *
11210  * if offset > 0: # <<<<<<<<<<<<<<
11211  * aligned_p += alignment - offset
11212  *
11213  */
11214  __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
11215  if (__pyx_t_1) {
11216 
11217  /* "View.MemoryView":307
11218  *
11219  * if offset > 0:
11220  * aligned_p += alignment - offset # <<<<<<<<<<<<<<
11221  *
11222  * return <void *> aligned_p
11223  */
11224  __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
11225 
11226  /* "View.MemoryView":306
11227  * offset = aligned_p % alignment
11228  *
11229  * if offset > 0: # <<<<<<<<<<<<<<
11230  * aligned_p += alignment - offset
11231  *
11232  */
11233  }
11234 
11235  /* "View.MemoryView":309
11236  * aligned_p += alignment - offset
11237  *
11238  * return <void *> aligned_p # <<<<<<<<<<<<<<
11239  *
11240  *
11241  */
11242  __pyx_r = ((void *)__pyx_v_aligned_p);
11243  goto __pyx_L0;
11244 
11245  /* "View.MemoryView":298
11246  *
11247  * @cname('__pyx_align_pointer')
11248  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
11249  * "Align pointer memory on a given boundary"
11250  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
11251  */
11252 
11253  /* function exit code */
11254  __pyx_L1_error:;
11255  __Pyx_WriteUnraisable("View.MemoryView.align_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
11256  __pyx_r = 0;
11257  __pyx_L0:;
11258  __Pyx_TraceReturn(Py_None, 1);
11259  return __pyx_r;
11260 }
11261 
11262 /* "View.MemoryView":345
11263  * cdef __Pyx_TypeInfo *typeinfo
11264  *
11265  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
11266  * self.obj = obj
11267  * self.flags = flags
11268  */
11269 
11270 /* Python wrapper */
11271 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
11272 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11273  PyObject *__pyx_v_obj = 0;
11274  int __pyx_v_flags;
11275  int __pyx_v_dtype_is_object;
11276  int __pyx_r;
11277  __Pyx_RefNannyDeclarations
11278  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
11279  {
11280  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
11281  PyObject* values[3] = {0,0,0};
11282  if (unlikely(__pyx_kwds)) {
11283  Py_ssize_t kw_args;
11284  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11285  switch (pos_args) {
11286  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11287  CYTHON_FALLTHROUGH;
11288  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11289  CYTHON_FALLTHROUGH;
11290  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11291  CYTHON_FALLTHROUGH;
11292  case 0: break;
11293  default: goto __pyx_L5_argtuple_error;
11294  }
11295  kw_args = PyDict_Size(__pyx_kwds);
11296  switch (pos_args) {
11297  case 0:
11298  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
11299  else goto __pyx_L5_argtuple_error;
11300  CYTHON_FALLTHROUGH;
11301  case 1:
11302  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
11303  else {
11304  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error)
11305  }
11306  CYTHON_FALLTHROUGH;
11307  case 2:
11308  if (kw_args > 0) {
11309  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
11310  if (value) { values[2] = value; kw_args--; }
11311  }
11312  }
11313  if (unlikely(kw_args > 0)) {
11314  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 345, __pyx_L3_error)
11315  }
11316  } else {
11317  switch (PyTuple_GET_SIZE(__pyx_args)) {
11318  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11319  CYTHON_FALLTHROUGH;
11320  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11321  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11322  break;
11323  default: goto __pyx_L5_argtuple_error;
11324  }
11325  }
11326  __pyx_v_obj = values[0];
11327  __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
11328  if (values[2]) {
11329  __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
11330  } else {
11331  __pyx_v_dtype_is_object = ((int)0);
11332  }
11333  }
11334  goto __pyx_L4_argument_unpacking_done;
11335  __pyx_L5_argtuple_error:;
11336  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 345, __pyx_L3_error)
11337  __pyx_L3_error:;
11338  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11339  __Pyx_RefNannyFinishContext();
11340  return -1;
11341  __pyx_L4_argument_unpacking_done:;
11342  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
11343 
11344  /* function exit code */
11345  __Pyx_RefNannyFinishContext();
11346  return __pyx_r;
11347 }
11348 
11349 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
11350  int __pyx_r;
11351  __Pyx_TraceDeclarations
11352  __Pyx_RefNannyDeclarations
11353  int __pyx_t_1;
11354  int __pyx_t_2;
11355  int __pyx_t_3;
11356  int __pyx_t_4;
11357  __Pyx_RefNannySetupContext("__cinit__", 0);
11358  __Pyx_TraceCall("__cinit__", __pyx_f[1], 345, 0, __PYX_ERR(1, 345, __pyx_L1_error));
11359 
11360  /* "View.MemoryView":346
11361  *
11362  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
11363  * self.obj = obj # <<<<<<<<<<<<<<
11364  * self.flags = flags
11365  * if type(self) is memoryview or obj is not None:
11366  */
11367  __Pyx_INCREF(__pyx_v_obj);
11368  __Pyx_GIVEREF(__pyx_v_obj);
11369  __Pyx_GOTREF(__pyx_v_self->obj);
11370  __Pyx_DECREF(__pyx_v_self->obj);
11371  __pyx_v_self->obj = __pyx_v_obj;
11372 
11373  /* "View.MemoryView":347
11374  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
11375  * self.obj = obj
11376  * self.flags = flags # <<<<<<<<<<<<<<
11377  * if type(self) is memoryview or obj is not None:
11378  * __Pyx_GetBuffer(obj, &self.view, flags)
11379  */
11380  __pyx_v_self->flags = __pyx_v_flags;
11381 
11382  /* "View.MemoryView":348
11383  * self.obj = obj
11384  * self.flags = flags
11385  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
11386  * __Pyx_GetBuffer(obj, &self.view, flags)
11387  * if <PyObject *> self.view.obj == NULL:
11388  */
11389  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
11390  __pyx_t_3 = (__pyx_t_2 != 0);
11391  if (!__pyx_t_3) {
11392  } else {
11393  __pyx_t_1 = __pyx_t_3;
11394  goto __pyx_L4_bool_binop_done;
11395  }
11396  __pyx_t_3 = (__pyx_v_obj != Py_None);
11397  __pyx_t_2 = (__pyx_t_3 != 0);
11398  __pyx_t_1 = __pyx_t_2;
11399  __pyx_L4_bool_binop_done:;
11400  if (__pyx_t_1) {
11401 
11402  /* "View.MemoryView":349
11403  * self.flags = flags
11404  * if type(self) is memoryview or obj is not None:
11405  * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
11406  * if <PyObject *> self.view.obj == NULL:
11407  * (<__pyx_buffer *> &self.view).obj = Py_None
11408  */
11409  __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 349, __pyx_L1_error)
11410 
11411  /* "View.MemoryView":350
11412  * if type(self) is memoryview or obj is not None:
11413  * __Pyx_GetBuffer(obj, &self.view, flags)
11414  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
11415  * (<__pyx_buffer *> &self.view).obj = Py_None
11416  * Py_INCREF(Py_None)
11417  */
11418  __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
11419  if (__pyx_t_1) {
11420 
11421  /* "View.MemoryView":351
11422  * __Pyx_GetBuffer(obj, &self.view, flags)
11423  * if <PyObject *> self.view.obj == NULL:
11424  * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
11425  * Py_INCREF(Py_None)
11426  *
11427  */
11428  ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
11429 
11430  /* "View.MemoryView":352
11431  * if <PyObject *> self.view.obj == NULL:
11432  * (<__pyx_buffer *> &self.view).obj = Py_None
11433  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
11434  *
11435  * global __pyx_memoryview_thread_locks_used
11436  */
11437  Py_INCREF(Py_None);
11438 
11439  /* "View.MemoryView":350
11440  * if type(self) is memoryview or obj is not None:
11441  * __Pyx_GetBuffer(obj, &self.view, flags)
11442  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
11443  * (<__pyx_buffer *> &self.view).obj = Py_None
11444  * Py_INCREF(Py_None)
11445  */
11446  }
11447 
11448  /* "View.MemoryView":348
11449  * self.obj = obj
11450  * self.flags = flags
11451  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
11452  * __Pyx_GetBuffer(obj, &self.view, flags)
11453  * if <PyObject *> self.view.obj == NULL:
11454  */
11455  }
11456 
11457  /* "View.MemoryView":355
11458  *
11459  * global __pyx_memoryview_thread_locks_used
11460  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
11461  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
11462  * __pyx_memoryview_thread_locks_used += 1
11463  */
11464  __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
11465  if (__pyx_t_1) {
11466 
11467  /* "View.MemoryView":356
11468  * global __pyx_memoryview_thread_locks_used
11469  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
11470  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
11471  * __pyx_memoryview_thread_locks_used += 1
11472  * if self.lock is NULL:
11473  */
11474  __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
11475 
11476  /* "View.MemoryView":357
11477  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
11478  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
11479  * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
11480  * if self.lock is NULL:
11481  * self.lock = PyThread_allocate_lock()
11482  */
11483  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
11484 
11485  /* "View.MemoryView":355
11486  *
11487  * global __pyx_memoryview_thread_locks_used
11488  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
11489  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
11490  * __pyx_memoryview_thread_locks_used += 1
11491  */
11492  }
11493 
11494  /* "View.MemoryView":358
11495  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
11496  * __pyx_memoryview_thread_locks_used += 1
11497  * if self.lock is NULL: # <<<<<<<<<<<<<<
11498  * self.lock = PyThread_allocate_lock()
11499  * if self.lock is NULL:
11500  */
11501  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
11502  if (__pyx_t_1) {
11503 
11504  /* "View.MemoryView":359
11505  * __pyx_memoryview_thread_locks_used += 1
11506  * if self.lock is NULL:
11507  * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
11508  * if self.lock is NULL:
11509  * raise MemoryError
11510  */
11511  __pyx_v_self->lock = PyThread_allocate_lock();
11512 
11513  /* "View.MemoryView":360
11514  * if self.lock is NULL:
11515  * self.lock = PyThread_allocate_lock()
11516  * if self.lock is NULL: # <<<<<<<<<<<<<<
11517  * raise MemoryError
11518  *
11519  */
11520  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
11521  if (unlikely(__pyx_t_1)) {
11522 
11523  /* "View.MemoryView":361
11524  * self.lock = PyThread_allocate_lock()
11525  * if self.lock is NULL:
11526  * raise MemoryError # <<<<<<<<<<<<<<
11527  *
11528  * if flags & PyBUF_FORMAT:
11529  */
11530  PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error)
11531 
11532  /* "View.MemoryView":360
11533  * if self.lock is NULL:
11534  * self.lock = PyThread_allocate_lock()
11535  * if self.lock is NULL: # <<<<<<<<<<<<<<
11536  * raise MemoryError
11537  *
11538  */
11539  }
11540 
11541  /* "View.MemoryView":358
11542  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
11543  * __pyx_memoryview_thread_locks_used += 1
11544  * if self.lock is NULL: # <<<<<<<<<<<<<<
11545  * self.lock = PyThread_allocate_lock()
11546  * if self.lock is NULL:
11547  */
11548  }
11549 
11550  /* "View.MemoryView":363
11551  * raise MemoryError
11552  *
11553  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
11554  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
11555  * else:
11556  */
11557  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
11558  if (__pyx_t_1) {
11559 
11560  /* "View.MemoryView":364
11561  *
11562  * if flags & PyBUF_FORMAT:
11563  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
11564  * else:
11565  * self.dtype_is_object = dtype_is_object
11566  */
11567  __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
11568  if (__pyx_t_2) {
11569  } else {
11570  __pyx_t_1 = __pyx_t_2;
11571  goto __pyx_L11_bool_binop_done;
11572  }
11573  __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
11574  __pyx_t_1 = __pyx_t_2;
11575  __pyx_L11_bool_binop_done:;
11576  __pyx_v_self->dtype_is_object = __pyx_t_1;
11577 
11578  /* "View.MemoryView":363
11579  * raise MemoryError
11580  *
11581  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
11582  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
11583  * else:
11584  */
11585  goto __pyx_L10;
11586  }
11587 
11588  /* "View.MemoryView":366
11589  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
11590  * else:
11591  * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
11592  *
11593  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
11594  */
11595  /*else*/ {
11596  __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
11597  }
11598  __pyx_L10:;
11599 
11600  /* "View.MemoryView":368
11601  * self.dtype_is_object = dtype_is_object
11602  *
11603  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
11604  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
11605  * self.typeinfo = NULL
11606  */
11607  __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
11608 
11609  /* "View.MemoryView":370
11610  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
11611  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
11612  * self.typeinfo = NULL # <<<<<<<<<<<<<<
11613  *
11614  * def __dealloc__(memoryview self):
11615  */
11616  __pyx_v_self->typeinfo = NULL;
11617 
11618  /* "View.MemoryView":345
11619  * cdef __Pyx_TypeInfo *typeinfo
11620  *
11621  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
11622  * self.obj = obj
11623  * self.flags = flags
11624  */
11625 
11626  /* function exit code */
11627  __pyx_r = 0;
11628  goto __pyx_L0;
11629  __pyx_L1_error:;
11630  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11631  __pyx_r = -1;
11632  __pyx_L0:;
11633  __Pyx_TraceReturn(Py_None, 0);
11634  __Pyx_RefNannyFinishContext();
11635  return __pyx_r;
11636 }
11637 
11638 /* "View.MemoryView":372
11639  * self.typeinfo = NULL
11640  *
11641  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
11642  * if self.obj is not None:
11643  * __Pyx_ReleaseBuffer(&self.view)
11644  */
11645 
11646 /* Python wrapper */
11647 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
11648 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
11649  __Pyx_RefNannyDeclarations
11650  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
11651  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11652 
11653  /* function exit code */
11654  __Pyx_RefNannyFinishContext();
11655 }
11656 
11657 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
11658  int __pyx_v_i;
11659  __Pyx_TraceDeclarations
11660  __Pyx_RefNannyDeclarations
11661  int __pyx_t_1;
11662  int __pyx_t_2;
11663  int __pyx_t_3;
11664  int __pyx_t_4;
11665  int __pyx_t_5;
11666  PyThread_type_lock __pyx_t_6;
11667  PyThread_type_lock __pyx_t_7;
11668  __Pyx_RefNannySetupContext("__dealloc__", 0);
11669  __Pyx_TraceCall("__dealloc__", __pyx_f[1], 372, 0, __PYX_ERR(1, 372, __pyx_L1_error));
11670 
11671  /* "View.MemoryView":373
11672  *
11673  * def __dealloc__(memoryview self):
11674  * if self.obj is not None: # <<<<<<<<<<<<<<
11675  * __Pyx_ReleaseBuffer(&self.view)
11676  *
11677  */
11678  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
11679  __pyx_t_2 = (__pyx_t_1 != 0);
11680  if (__pyx_t_2) {
11681 
11682  /* "View.MemoryView":374
11683  * def __dealloc__(memoryview self):
11684  * if self.obj is not None:
11685  * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
11686  *
11687  * cdef int i
11688  */
11689  __Pyx_ReleaseBuffer((&__pyx_v_self->view));
11690 
11691  /* "View.MemoryView":373
11692  *
11693  * def __dealloc__(memoryview self):
11694  * if self.obj is not None: # <<<<<<<<<<<<<<
11695  * __Pyx_ReleaseBuffer(&self.view)
11696  *
11697  */
11698  }
11699 
11700  /* "View.MemoryView":378
11701  * cdef int i
11702  * global __pyx_memoryview_thread_locks_used
11703  * if self.lock != NULL: # <<<<<<<<<<<<<<
11704  * for i in range(__pyx_memoryview_thread_locks_used):
11705  * if __pyx_memoryview_thread_locks[i] is self.lock:
11706  */
11707  __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
11708  if (__pyx_t_2) {
11709 
11710  /* "View.MemoryView":379
11711  * global __pyx_memoryview_thread_locks_used
11712  * if self.lock != NULL:
11713  * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
11714  * if __pyx_memoryview_thread_locks[i] is self.lock:
11715  * __pyx_memoryview_thread_locks_used -= 1
11716  */
11717  __pyx_t_3 = __pyx_memoryview_thread_locks_used;
11718  __pyx_t_4 = __pyx_t_3;
11719  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
11720  __pyx_v_i = __pyx_t_5;
11721 
11722  /* "View.MemoryView":380
11723  * if self.lock != NULL:
11724  * for i in range(__pyx_memoryview_thread_locks_used):
11725  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
11726  * __pyx_memoryview_thread_locks_used -= 1
11727  * if i != __pyx_memoryview_thread_locks_used:
11728  */
11729  __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
11730  if (__pyx_t_2) {
11731 
11732  /* "View.MemoryView":381
11733  * for i in range(__pyx_memoryview_thread_locks_used):
11734  * if __pyx_memoryview_thread_locks[i] is self.lock:
11735  * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
11736  * if i != __pyx_memoryview_thread_locks_used:
11737  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11738  */
11739  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
11740 
11741  /* "View.MemoryView":382
11742  * if __pyx_memoryview_thread_locks[i] is self.lock:
11743  * __pyx_memoryview_thread_locks_used -= 1
11744  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
11745  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11746  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11747  */
11748  __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
11749  if (__pyx_t_2) {
11750 
11751  /* "View.MemoryView":384
11752  * if i != __pyx_memoryview_thread_locks_used:
11753  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11754  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
11755  * break
11756  * else:
11757  */
11758  __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
11759  __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
11760 
11761  /* "View.MemoryView":383
11762  * __pyx_memoryview_thread_locks_used -= 1
11763  * if i != __pyx_memoryview_thread_locks_used:
11764  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
11765  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11766  * break
11767  */
11768  (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
11769  (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
11770 
11771  /* "View.MemoryView":382
11772  * if __pyx_memoryview_thread_locks[i] is self.lock:
11773  * __pyx_memoryview_thread_locks_used -= 1
11774  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
11775  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11776  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11777  */
11778  }
11779 
11780  /* "View.MemoryView":385
11781  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11782  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11783  * break # <<<<<<<<<<<<<<
11784  * else:
11785  * PyThread_free_lock(self.lock)
11786  */
11787  goto __pyx_L6_break;
11788 
11789  /* "View.MemoryView":380
11790  * if self.lock != NULL:
11791  * for i in range(__pyx_memoryview_thread_locks_used):
11792  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
11793  * __pyx_memoryview_thread_locks_used -= 1
11794  * if i != __pyx_memoryview_thread_locks_used:
11795  */
11796  }
11797  }
11798  /*else*/ {
11799 
11800  /* "View.MemoryView":387
11801  * break
11802  * else:
11803  * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
11804  *
11805  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
11806  */
11807  PyThread_free_lock(__pyx_v_self->lock);
11808  }
11809  __pyx_L6_break:;
11810 
11811  /* "View.MemoryView":378
11812  * cdef int i
11813  * global __pyx_memoryview_thread_locks_used
11814  * if self.lock != NULL: # <<<<<<<<<<<<<<
11815  * for i in range(__pyx_memoryview_thread_locks_used):
11816  * if __pyx_memoryview_thread_locks[i] is self.lock:
11817  */
11818  }
11819 
11820  /* "View.MemoryView":372
11821  * self.typeinfo = NULL
11822  *
11823  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
11824  * if self.obj is not None:
11825  * __Pyx_ReleaseBuffer(&self.view)
11826  */
11827 
11828  /* function exit code */
11829  goto __pyx_L0;
11830  __pyx_L1_error:;
11831  __Pyx_WriteUnraisable("View.MemoryView.memoryview.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
11832  __pyx_L0:;
11833  __Pyx_TraceReturn(Py_None, 0);
11834  __Pyx_RefNannyFinishContext();
11835 }
11836 
11837 /* "View.MemoryView":389
11838  * PyThread_free_lock(self.lock)
11839  *
11840  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
11841  * cdef Py_ssize_t dim
11842  * cdef char *itemp = <char *> self.view.buf
11843  */
11844 
11845 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11846  Py_ssize_t __pyx_v_dim;
11847  char *__pyx_v_itemp;
11848  PyObject *__pyx_v_idx = NULL;
11849  char *__pyx_r;
11850  __Pyx_TraceDeclarations
11851  __Pyx_RefNannyDeclarations
11852  Py_ssize_t __pyx_t_1;
11853  PyObject *__pyx_t_2 = NULL;
11854  Py_ssize_t __pyx_t_3;
11855  PyObject *(*__pyx_t_4)(PyObject *);
11856  PyObject *__pyx_t_5 = NULL;
11857  Py_ssize_t __pyx_t_6;
11858  char *__pyx_t_7;
11859  __Pyx_RefNannySetupContext("get_item_pointer", 0);
11860  __Pyx_TraceCall("get_item_pointer", __pyx_f[1], 389, 0, __PYX_ERR(1, 389, __pyx_L1_error));
11861 
11862  /* "View.MemoryView":391
11863  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
11864  * cdef Py_ssize_t dim
11865  * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
11866  *
11867  * for dim, idx in enumerate(index):
11868  */
11869  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
11870 
11871  /* "View.MemoryView":393
11872  * cdef char *itemp = <char *> self.view.buf
11873  *
11874  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
11875  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11876  *
11877  */
11878  __pyx_t_1 = 0;
11879  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
11880  __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
11881  __pyx_t_4 = NULL;
11882  } else {
11883  __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 393, __pyx_L1_error)
11884  __Pyx_GOTREF(__pyx_t_2);
11885  __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 393, __pyx_L1_error)
11886  }
11887  for (;;) {
11888  if (likely(!__pyx_t_4)) {
11889  if (likely(PyList_CheckExact(__pyx_t_2))) {
11890  if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
11891  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11892  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 393, __pyx_L1_error)
11893  #else
11894  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 393, __pyx_L1_error)
11895  __Pyx_GOTREF(__pyx_t_5);
11896  #endif
11897  } else {
11898  if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
11899  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11900  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 393, __pyx_L1_error)
11901  #else
11902  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 393, __pyx_L1_error)
11903  __Pyx_GOTREF(__pyx_t_5);
11904  #endif
11905  }
11906  } else {
11907  __pyx_t_5 = __pyx_t_4(__pyx_t_2);
11908  if (unlikely(!__pyx_t_5)) {
11909  PyObject* exc_type = PyErr_Occurred();
11910  if (exc_type) {
11911  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
11912  else __PYX_ERR(1, 393, __pyx_L1_error)
11913  }
11914  break;
11915  }
11916  __Pyx_GOTREF(__pyx_t_5);
11917  }
11918  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
11919  __pyx_t_5 = 0;
11920  __pyx_v_dim = __pyx_t_1;
11921  __pyx_t_1 = (__pyx_t_1 + 1);
11922 
11923  /* "View.MemoryView":394
11924  *
11925  * for dim, idx in enumerate(index):
11926  * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
11927  *
11928  * return itemp
11929  */
11930  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 394, __pyx_L1_error)
11931  __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 394, __pyx_L1_error)
11932  __pyx_v_itemp = __pyx_t_7;
11933 
11934  /* "View.MemoryView":393
11935  * cdef char *itemp = <char *> self.view.buf
11936  *
11937  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
11938  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11939  *
11940  */
11941  }
11942  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11943 
11944  /* "View.MemoryView":396
11945  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11946  *
11947  * return itemp # <<<<<<<<<<<<<<
11948  *
11949  *
11950  */
11951  __pyx_r = __pyx_v_itemp;
11952  goto __pyx_L0;
11953 
11954  /* "View.MemoryView":389
11955  * PyThread_free_lock(self.lock)
11956  *
11957  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
11958  * cdef Py_ssize_t dim
11959  * cdef char *itemp = <char *> self.view.buf
11960  */
11961 
11962  /* function exit code */
11963  __pyx_L1_error:;
11964  __Pyx_XDECREF(__pyx_t_2);
11965  __Pyx_XDECREF(__pyx_t_5);
11966  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
11967  __pyx_r = NULL;
11968  __pyx_L0:;
11969  __Pyx_XDECREF(__pyx_v_idx);
11970  __Pyx_TraceReturn(Py_None, 0);
11971  __Pyx_RefNannyFinishContext();
11972  return __pyx_r;
11973 }
11974 
11975 /* "View.MemoryView":399
11976  *
11977  *
11978  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
11979  * if index is Ellipsis:
11980  * return self
11981  */
11982 
11983 /* Python wrapper */
11984 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
11985 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
11986  PyObject *__pyx_r = 0;
11987  __Pyx_RefNannyDeclarations
11988  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
11989  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
11990 
11991  /* function exit code */
11992  __Pyx_RefNannyFinishContext();
11993  return __pyx_r;
11994 }
11995 
11996 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11997  PyObject *__pyx_v_have_slices = NULL;
11998  PyObject *__pyx_v_indices = NULL;
11999  char *__pyx_v_itemp;
12000  PyObject *__pyx_r = NULL;
12001  __Pyx_TraceDeclarations
12002  __Pyx_RefNannyDeclarations
12003  int __pyx_t_1;
12004  int __pyx_t_2;
12005  PyObject *__pyx_t_3 = NULL;
12006  PyObject *__pyx_t_4 = NULL;
12007  PyObject *__pyx_t_5 = NULL;
12008  char *__pyx_t_6;
12009  __Pyx_RefNannySetupContext("__getitem__", 0);
12010  __Pyx_TraceCall("__getitem__", __pyx_f[1], 399, 0, __PYX_ERR(1, 399, __pyx_L1_error));
12011 
12012  /* "View.MemoryView":400
12013  *
12014  * def __getitem__(memoryview self, object index):
12015  * if index is Ellipsis: # <<<<<<<<<<<<<<
12016  * return self
12017  *
12018  */
12019  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
12020  __pyx_t_2 = (__pyx_t_1 != 0);
12021  if (__pyx_t_2) {
12022 
12023  /* "View.MemoryView":401
12024  * def __getitem__(memoryview self, object index):
12025  * if index is Ellipsis:
12026  * return self # <<<<<<<<<<<<<<
12027  *
12028  * have_slices, indices = _unellipsify(index, self.view.ndim)
12029  */
12030  __Pyx_XDECREF(__pyx_r);
12031  __Pyx_INCREF(((PyObject *)__pyx_v_self));
12032  __pyx_r = ((PyObject *)__pyx_v_self);
12033  goto __pyx_L0;
12034 
12035  /* "View.MemoryView":400
12036  *
12037  * def __getitem__(memoryview self, object index):
12038  * if index is Ellipsis: # <<<<<<<<<<<<<<
12039  * return self
12040  *
12041  */
12042  }
12043 
12044  /* "View.MemoryView":403
12045  * return self
12046  *
12047  * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
12048  *
12049  * cdef char *itemp
12050  */
12051  __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 403, __pyx_L1_error)
12052  __Pyx_GOTREF(__pyx_t_3);
12053  if (likely(__pyx_t_3 != Py_None)) {
12054  PyObject* sequence = __pyx_t_3;
12055  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
12056  if (unlikely(size != 2)) {
12057  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
12058  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
12059  __PYX_ERR(1, 403, __pyx_L1_error)
12060  }
12061  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12062  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
12063  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
12064  __Pyx_INCREF(__pyx_t_4);
12065  __Pyx_INCREF(__pyx_t_5);
12066  #else
12067  __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 403, __pyx_L1_error)
12068  __Pyx_GOTREF(__pyx_t_4);
12069  __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 403, __pyx_L1_error)
12070  __Pyx_GOTREF(__pyx_t_5);
12071  #endif
12072  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12073  } else {
12074  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 403, __pyx_L1_error)
12075  }
12076  __pyx_v_have_slices = __pyx_t_4;
12077  __pyx_t_4 = 0;
12078  __pyx_v_indices = __pyx_t_5;
12079  __pyx_t_5 = 0;
12080 
12081  /* "View.MemoryView":406
12082  *
12083  * cdef char *itemp
12084  * if have_slices: # <<<<<<<<<<<<<<
12085  * return memview_slice(self, indices)
12086  * else:
12087  */
12088  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 406, __pyx_L1_error)
12089  if (__pyx_t_2) {
12090 
12091  /* "View.MemoryView":407
12092  * cdef char *itemp
12093  * if have_slices:
12094  * return memview_slice(self, indices) # <<<<<<<<<<<<<<
12095  * else:
12096  * itemp = self.get_item_pointer(indices)
12097  */
12098  __Pyx_XDECREF(__pyx_r);
12099  __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error)
12100  __Pyx_GOTREF(__pyx_t_3);
12101  __pyx_r = __pyx_t_3;
12102  __pyx_t_3 = 0;
12103  goto __pyx_L0;
12104 
12105  /* "View.MemoryView":406
12106  *
12107  * cdef char *itemp
12108  * if have_slices: # <<<<<<<<<<<<<<
12109  * return memview_slice(self, indices)
12110  * else:
12111  */
12112  }
12113 
12114  /* "View.MemoryView":409
12115  * return memview_slice(self, indices)
12116  * else:
12117  * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
12118  * return self.convert_item_to_object(itemp)
12119  *
12120  */
12121  /*else*/ {
12122  __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(1, 409, __pyx_L1_error)
12123  __pyx_v_itemp = __pyx_t_6;
12124 
12125  /* "View.MemoryView":410
12126  * else:
12127  * itemp = self.get_item_pointer(indices)
12128  * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
12129  *
12130  * def __setitem__(memoryview self, object index, object value):
12131  */
12132  __Pyx_XDECREF(__pyx_r);
12133  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 410, __pyx_L1_error)
12134  __Pyx_GOTREF(__pyx_t_3);
12135  __pyx_r = __pyx_t_3;
12136  __pyx_t_3 = 0;
12137  goto __pyx_L0;
12138  }
12139 
12140  /* "View.MemoryView":399
12141  *
12142  *
12143  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
12144  * if index is Ellipsis:
12145  * return self
12146  */
12147 
12148  /* function exit code */
12149  __pyx_L1_error:;
12150  __Pyx_XDECREF(__pyx_t_3);
12151  __Pyx_XDECREF(__pyx_t_4);
12152  __Pyx_XDECREF(__pyx_t_5);
12153  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12154  __pyx_r = NULL;
12155  __pyx_L0:;
12156  __Pyx_XDECREF(__pyx_v_have_slices);
12157  __Pyx_XDECREF(__pyx_v_indices);
12158  __Pyx_XGIVEREF(__pyx_r);
12159  __Pyx_TraceReturn(__pyx_r, 0);
12160  __Pyx_RefNannyFinishContext();
12161  return __pyx_r;
12162 }
12163 
12164 /* "View.MemoryView":412
12165  * return self.convert_item_to_object(itemp)
12166  *
12167  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
12168  * if self.view.readonly:
12169  * raise TypeError("Cannot assign to read-only memoryview")
12170  */
12171 
12172 /* Python wrapper */
12173 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
12174 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12175  int __pyx_r;
12176  __Pyx_RefNannyDeclarations
12177  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
12178  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
12179 
12180  /* function exit code */
12181  __Pyx_RefNannyFinishContext();
12182  return __pyx_r;
12183 }
12184 
12185 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12186  PyObject *__pyx_v_have_slices = NULL;
12187  PyObject *__pyx_v_obj = NULL;
12188  int __pyx_r;
12189  __Pyx_TraceDeclarations
12190  __Pyx_RefNannyDeclarations
12191  int __pyx_t_1;
12192  PyObject *__pyx_t_2 = NULL;
12193  PyObject *__pyx_t_3 = NULL;
12194  PyObject *__pyx_t_4 = NULL;
12195  __Pyx_RefNannySetupContext("__setitem__", 0);
12196  __Pyx_TraceCall("__setitem__", __pyx_f[1], 412, 0, __PYX_ERR(1, 412, __pyx_L1_error));
12197  __Pyx_INCREF(__pyx_v_index);
12198 
12199  /* "View.MemoryView":413
12200  *
12201  * def __setitem__(memoryview self, object index, object value):
12202  * if self.view.readonly: # <<<<<<<<<<<<<<
12203  * raise TypeError("Cannot assign to read-only memoryview")
12204  *
12205  */
12206  __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
12207  if (unlikely(__pyx_t_1)) {
12208 
12209  /* "View.MemoryView":414
12210  * def __setitem__(memoryview self, object index, object value):
12211  * if self.view.readonly:
12212  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
12213  *
12214  * have_slices, index = _unellipsify(index, self.view.ndim)
12215  */
12216  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 414, __pyx_L1_error)
12217  __Pyx_GOTREF(__pyx_t_2);
12218  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
12219  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12220  __PYX_ERR(1, 414, __pyx_L1_error)
12221 
12222  /* "View.MemoryView":413
12223  *
12224  * def __setitem__(memoryview self, object index, object value):
12225  * if self.view.readonly: # <<<<<<<<<<<<<<
12226  * raise TypeError("Cannot assign to read-only memoryview")
12227  *
12228  */
12229  }
12230 
12231  /* "View.MemoryView":416
12232  * raise TypeError("Cannot assign to read-only memoryview")
12233  *
12234  * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
12235  *
12236  * if have_slices:
12237  */
12238  __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 416, __pyx_L1_error)
12239  __Pyx_GOTREF(__pyx_t_2);
12240  if (likely(__pyx_t_2 != Py_None)) {
12241  PyObject* sequence = __pyx_t_2;
12242  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
12243  if (unlikely(size != 2)) {
12244  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
12245  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
12246  __PYX_ERR(1, 416, __pyx_L1_error)
12247  }
12248  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12249  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
12250  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
12251  __Pyx_INCREF(__pyx_t_3);
12252  __Pyx_INCREF(__pyx_t_4);
12253  #else
12254  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __pyx_L1_error)
12255  __Pyx_GOTREF(__pyx_t_3);
12256  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 416, __pyx_L1_error)
12257  __Pyx_GOTREF(__pyx_t_4);
12258  #endif
12259  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12260  } else {
12261  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 416, __pyx_L1_error)
12262  }
12263  __pyx_v_have_slices = __pyx_t_3;
12264  __pyx_t_3 = 0;
12265  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
12266  __pyx_t_4 = 0;
12267 
12268  /* "View.MemoryView":418
12269  * have_slices, index = _unellipsify(index, self.view.ndim)
12270  *
12271  * if have_slices: # <<<<<<<<<<<<<<
12272  * obj = self.is_slice(value)
12273  * if obj:
12274  */
12275  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 418, __pyx_L1_error)
12276  if (__pyx_t_1) {
12277 
12278  /* "View.MemoryView":419
12279  *
12280  * if have_slices:
12281  * obj = self.is_slice(value) # <<<<<<<<<<<<<<
12282  * if obj:
12283  * self.setitem_slice_assignment(self[index], obj)
12284  */
12285  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 419, __pyx_L1_error)
12286  __Pyx_GOTREF(__pyx_t_2);
12287  __pyx_v_obj = __pyx_t_2;
12288  __pyx_t_2 = 0;
12289 
12290  /* "View.MemoryView":420
12291  * if have_slices:
12292  * obj = self.is_slice(value)
12293  * if obj: # <<<<<<<<<<<<<<
12294  * self.setitem_slice_assignment(self[index], obj)
12295  * else:
12296  */
12297  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 420, __pyx_L1_error)
12298  if (__pyx_t_1) {
12299 
12300  /* "View.MemoryView":421
12301  * obj = self.is_slice(value)
12302  * if obj:
12303  * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
12304  * else:
12305  * self.setitem_slice_assign_scalar(self[index], value)
12306  */
12307  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 421, __pyx_L1_error)
12308  __Pyx_GOTREF(__pyx_t_2);
12309  __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 421, __pyx_L1_error)
12310  __Pyx_GOTREF(__pyx_t_4);
12311  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12312  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12313 
12314  /* "View.MemoryView":420
12315  * if have_slices:
12316  * obj = self.is_slice(value)
12317  * if obj: # <<<<<<<<<<<<<<
12318  * self.setitem_slice_assignment(self[index], obj)
12319  * else:
12320  */
12321  goto __pyx_L5;
12322  }
12323 
12324  /* "View.MemoryView":423
12325  * self.setitem_slice_assignment(self[index], obj)
12326  * else:
12327  * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
12328  * else:
12329  * self.setitem_indexed(index, value)
12330  */
12331  /*else*/ {
12332  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 423, __pyx_L1_error)
12333  __Pyx_GOTREF(__pyx_t_4);
12334  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 423, __pyx_L1_error)
12335  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 423, __pyx_L1_error)
12336  __Pyx_GOTREF(__pyx_t_2);
12337  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12338  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12339  }
12340  __pyx_L5:;
12341 
12342  /* "View.MemoryView":418
12343  * have_slices, index = _unellipsify(index, self.view.ndim)
12344  *
12345  * if have_slices: # <<<<<<<<<<<<<<
12346  * obj = self.is_slice(value)
12347  * if obj:
12348  */
12349  goto __pyx_L4;
12350  }
12351 
12352  /* "View.MemoryView":425
12353  * self.setitem_slice_assign_scalar(self[index], value)
12354  * else:
12355  * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
12356  *
12357  * cdef is_slice(self, obj):
12358  */
12359  /*else*/ {
12360  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
12361  __Pyx_GOTREF(__pyx_t_2);
12362  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12363  }
12364  __pyx_L4:;
12365 
12366  /* "View.MemoryView":412
12367  * return self.convert_item_to_object(itemp)
12368  *
12369  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
12370  * if self.view.readonly:
12371  * raise TypeError("Cannot assign to read-only memoryview")
12372  */
12373 
12374  /* function exit code */
12375  __pyx_r = 0;
12376  goto __pyx_L0;
12377  __pyx_L1_error:;
12378  __Pyx_XDECREF(__pyx_t_2);
12379  __Pyx_XDECREF(__pyx_t_3);
12380  __Pyx_XDECREF(__pyx_t_4);
12381  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12382  __pyx_r = -1;
12383  __pyx_L0:;
12384  __Pyx_XDECREF(__pyx_v_have_slices);
12385  __Pyx_XDECREF(__pyx_v_obj);
12386  __Pyx_XDECREF(__pyx_v_index);
12387  __Pyx_TraceReturn(Py_None, 0);
12388  __Pyx_RefNannyFinishContext();
12389  return __pyx_r;
12390 }
12391 
12392 /* "View.MemoryView":427
12393  * self.setitem_indexed(index, value)
12394  *
12395  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
12396  * if not isinstance(obj, memoryview):
12397  * try:
12398  */
12399 
12400 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
12401  PyObject *__pyx_r = NULL;
12402  __Pyx_TraceDeclarations
12403  __Pyx_RefNannyDeclarations
12404  int __pyx_t_1;
12405  int __pyx_t_2;
12406  PyObject *__pyx_t_3 = NULL;
12407  PyObject *__pyx_t_4 = NULL;
12408  PyObject *__pyx_t_5 = NULL;
12409  PyObject *__pyx_t_6 = NULL;
12410  PyObject *__pyx_t_7 = NULL;
12411  PyObject *__pyx_t_8 = NULL;
12412  int __pyx_t_9;
12413  __Pyx_RefNannySetupContext("is_slice", 0);
12414  __Pyx_TraceCall("is_slice", __pyx_f[1], 427, 0, __PYX_ERR(1, 427, __pyx_L1_error));
12415  __Pyx_INCREF(__pyx_v_obj);
12416 
12417  /* "View.MemoryView":428
12418  *
12419  * cdef is_slice(self, obj):
12420  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
12421  * try:
12422  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12423  */
12424  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
12425  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
12426  if (__pyx_t_2) {
12427 
12428  /* "View.MemoryView":429
12429  * cdef is_slice(self, obj):
12430  * if not isinstance(obj, memoryview):
12431  * try: # <<<<<<<<<<<<<<
12432  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12433  * self.dtype_is_object)
12434  */
12435  {
12436  __Pyx_PyThreadState_declare
12437  __Pyx_PyThreadState_assign
12438  __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
12439  __Pyx_XGOTREF(__pyx_t_3);
12440  __Pyx_XGOTREF(__pyx_t_4);
12441  __Pyx_XGOTREF(__pyx_t_5);
12442  /*try:*/ {
12443 
12444  /* "View.MemoryView":430
12445  * if not isinstance(obj, memoryview):
12446  * try:
12447  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
12448  * self.dtype_is_object)
12449  * except TypeError:
12450  */
12451  __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 430, __pyx_L4_error)
12452  __Pyx_GOTREF(__pyx_t_6);
12453 
12454  /* "View.MemoryView":431
12455  * try:
12456  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12457  * self.dtype_is_object) # <<<<<<<<<<<<<<
12458  * except TypeError:
12459  * return None
12460  */
12461  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 431, __pyx_L4_error)
12462  __Pyx_GOTREF(__pyx_t_7);
12463 
12464  /* "View.MemoryView":430
12465  * if not isinstance(obj, memoryview):
12466  * try:
12467  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
12468  * self.dtype_is_object)
12469  * except TypeError:
12470  */
12471  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 430, __pyx_L4_error)
12472  __Pyx_GOTREF(__pyx_t_8);
12473  __Pyx_INCREF(__pyx_v_obj);
12474  __Pyx_GIVEREF(__pyx_v_obj);
12475  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
12476  __Pyx_GIVEREF(__pyx_t_6);
12477  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
12478  __Pyx_GIVEREF(__pyx_t_7);
12479  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
12480  __pyx_t_6 = 0;
12481  __pyx_t_7 = 0;
12482  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 430, __pyx_L4_error)
12483  __Pyx_GOTREF(__pyx_t_7);
12484  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12485  __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
12486  __pyx_t_7 = 0;
12487 
12488  /* "View.MemoryView":429
12489  * cdef is_slice(self, obj):
12490  * if not isinstance(obj, memoryview):
12491  * try: # <<<<<<<<<<<<<<
12492  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12493  * self.dtype_is_object)
12494  */
12495  }
12496  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12497  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12498  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12499  goto __pyx_L9_try_end;
12500  __pyx_L4_error:;
12501  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12502  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
12503  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12504 
12505  /* "View.MemoryView":432
12506  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12507  * self.dtype_is_object)
12508  * except TypeError: # <<<<<<<<<<<<<<
12509  * return None
12510  *
12511  */
12512  __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
12513  if (__pyx_t_9) {
12514  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
12515  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 432, __pyx_L6_except_error)
12516  __Pyx_GOTREF(__pyx_t_7);
12517  __Pyx_GOTREF(__pyx_t_8);
12518  __Pyx_GOTREF(__pyx_t_6);
12519 
12520  /* "View.MemoryView":433
12521  * self.dtype_is_object)
12522  * except TypeError:
12523  * return None # <<<<<<<<<<<<<<
12524  *
12525  * return obj
12526  */
12527  __Pyx_XDECREF(__pyx_r);
12528  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12529  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12530  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12531  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12532  goto __pyx_L7_except_return;
12533  }
12534  goto __pyx_L6_except_error;
12535  __pyx_L6_except_error:;
12536 
12537  /* "View.MemoryView":429
12538  * cdef is_slice(self, obj):
12539  * if not isinstance(obj, memoryview):
12540  * try: # <<<<<<<<<<<<<<
12541  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12542  * self.dtype_is_object)
12543  */
12544  __Pyx_XGIVEREF(__pyx_t_3);
12545  __Pyx_XGIVEREF(__pyx_t_4);
12546  __Pyx_XGIVEREF(__pyx_t_5);
12547  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12548  goto __pyx_L1_error;
12549  __pyx_L7_except_return:;
12550  __Pyx_XGIVEREF(__pyx_t_3);
12551  __Pyx_XGIVEREF(__pyx_t_4);
12552  __Pyx_XGIVEREF(__pyx_t_5);
12553  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12554  goto __pyx_L0;
12555  __pyx_L9_try_end:;
12556  }
12557 
12558  /* "View.MemoryView":428
12559  *
12560  * cdef is_slice(self, obj):
12561  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
12562  * try:
12563  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12564  */
12565  }
12566 
12567  /* "View.MemoryView":435
12568  * return None
12569  *
12570  * return obj # <<<<<<<<<<<<<<
12571  *
12572  * cdef setitem_slice_assignment(self, dst, src):
12573  */
12574  __Pyx_XDECREF(__pyx_r);
12575  __Pyx_INCREF(__pyx_v_obj);
12576  __pyx_r = __pyx_v_obj;
12577  goto __pyx_L0;
12578 
12579  /* "View.MemoryView":427
12580  * self.setitem_indexed(index, value)
12581  *
12582  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
12583  * if not isinstance(obj, memoryview):
12584  * try:
12585  */
12586 
12587  /* function exit code */
12588  __pyx_L1_error:;
12589  __Pyx_XDECREF(__pyx_t_6);
12590  __Pyx_XDECREF(__pyx_t_7);
12591  __Pyx_XDECREF(__pyx_t_8);
12592  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
12593  __pyx_r = 0;
12594  __pyx_L0:;
12595  __Pyx_XDECREF(__pyx_v_obj);
12596  __Pyx_XGIVEREF(__pyx_r);
12597  __Pyx_TraceReturn(__pyx_r, 0);
12598  __Pyx_RefNannyFinishContext();
12599  return __pyx_r;
12600 }
12601 
12602 /* "View.MemoryView":437
12603  * return obj
12604  *
12605  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
12606  * cdef __Pyx_memviewslice dst_slice
12607  * cdef __Pyx_memviewslice src_slice
12608  */
12609 
12610 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
12611  __Pyx_memviewslice __pyx_v_dst_slice;
12612  __Pyx_memviewslice __pyx_v_src_slice;
12613  PyObject *__pyx_r = NULL;
12614  __Pyx_TraceDeclarations
12615  __Pyx_RefNannyDeclarations
12616  PyObject *__pyx_t_1 = NULL;
12617  int __pyx_t_2;
12618  int __pyx_t_3;
12619  int __pyx_t_4;
12620  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
12621  __Pyx_TraceCall("setitem_slice_assignment", __pyx_f[1], 437, 0, __PYX_ERR(1, 437, __pyx_L1_error));
12622 
12623  /* "View.MemoryView":441
12624  * cdef __Pyx_memviewslice src_slice
12625  *
12626  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
12627  * get_slice_from_memview(dst, &dst_slice)[0],
12628  * src.ndim, dst.ndim, self.dtype_is_object)
12629  */
12630  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 441, __pyx_L1_error)
12631 
12632  /* "View.MemoryView":442
12633  *
12634  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
12635  * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
12636  * src.ndim, dst.ndim, self.dtype_is_object)
12637  *
12638  */
12639  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 442, __pyx_L1_error)
12640 
12641  /* "View.MemoryView":443
12642  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
12643  * get_slice_from_memview(dst, &dst_slice)[0],
12644  * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
12645  *
12646  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
12647  */
12648  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 443, __pyx_L1_error)
12649  __Pyx_GOTREF(__pyx_t_1);
12650  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 443, __pyx_L1_error)
12651  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12652  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 443, __pyx_L1_error)
12653  __Pyx_GOTREF(__pyx_t_1);
12654  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 443, __pyx_L1_error)
12655  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12656 
12657  /* "View.MemoryView":441
12658  * cdef __Pyx_memviewslice src_slice
12659  *
12660  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
12661  * get_slice_from_memview(dst, &dst_slice)[0],
12662  * src.ndim, dst.ndim, self.dtype_is_object)
12663  */
12664  __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 441, __pyx_L1_error)
12665 
12666  /* "View.MemoryView":437
12667  * return obj
12668  *
12669  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
12670  * cdef __Pyx_memviewslice dst_slice
12671  * cdef __Pyx_memviewslice src_slice
12672  */
12673 
12674  /* function exit code */
12675  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12676  goto __pyx_L0;
12677  __pyx_L1_error:;
12678  __Pyx_XDECREF(__pyx_t_1);
12679  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
12680  __pyx_r = 0;
12681  __pyx_L0:;
12682  __Pyx_XGIVEREF(__pyx_r);
12683  __Pyx_TraceReturn(__pyx_r, 0);
12684  __Pyx_RefNannyFinishContext();
12685  return __pyx_r;
12686 }
12687 
12688 /* "View.MemoryView":445
12689  * src.ndim, dst.ndim, self.dtype_is_object)
12690  *
12691  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
12692  * cdef int array[128]
12693  * cdef void *tmp = NULL
12694  */
12695 
12696 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
12697  int __pyx_v_array[0x80];
12698  void *__pyx_v_tmp;
12699  void *__pyx_v_item;
12700  __Pyx_memviewslice *__pyx_v_dst_slice;
12701  __Pyx_memviewslice __pyx_v_tmp_slice;
12702  PyObject *__pyx_r = NULL;
12703  __Pyx_TraceDeclarations
12704  __Pyx_RefNannyDeclarations
12705  int __pyx_t_1;
12706  PyObject *__pyx_t_2 = NULL;
12707  int __pyx_t_3;
12708  int __pyx_t_4;
12709  char const *__pyx_t_5;
12710  PyObject *__pyx_t_6 = NULL;
12711  PyObject *__pyx_t_7 = NULL;
12712  PyObject *__pyx_t_8 = NULL;
12713  PyObject *__pyx_t_9 = NULL;
12714  PyObject *__pyx_t_10 = NULL;
12715  PyObject *__pyx_t_11 = NULL;
12716  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
12717  __Pyx_TraceCall("setitem_slice_assign_scalar", __pyx_f[1], 445, 0, __PYX_ERR(1, 445, __pyx_L1_error));
12718 
12719  /* "View.MemoryView":447
12720  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
12721  * cdef int array[128]
12722  * cdef void *tmp = NULL # <<<<<<<<<<<<<<
12723  * cdef void *item
12724  *
12725  */
12726  __pyx_v_tmp = NULL;
12727 
12728  /* "View.MemoryView":452
12729  * cdef __Pyx_memviewslice *dst_slice
12730  * cdef __Pyx_memviewslice tmp_slice
12731  * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
12732  *
12733  * if <size_t>self.view.itemsize > sizeof(array):
12734  */
12735  __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
12736 
12737  /* "View.MemoryView":454
12738  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
12739  *
12740  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
12741  * tmp = PyMem_Malloc(self.view.itemsize)
12742  * if tmp == NULL:
12743  */
12744  __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
12745  if (__pyx_t_1) {
12746 
12747  /* "View.MemoryView":455
12748  *
12749  * if <size_t>self.view.itemsize > sizeof(array):
12750  * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
12751  * if tmp == NULL:
12752  * raise MemoryError
12753  */
12754  __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
12755 
12756  /* "View.MemoryView":456
12757  * if <size_t>self.view.itemsize > sizeof(array):
12758  * tmp = PyMem_Malloc(self.view.itemsize)
12759  * if tmp == NULL: # <<<<<<<<<<<<<<
12760  * raise MemoryError
12761  * item = tmp
12762  */
12763  __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
12764  if (unlikely(__pyx_t_1)) {
12765 
12766  /* "View.MemoryView":457
12767  * tmp = PyMem_Malloc(self.view.itemsize)
12768  * if tmp == NULL:
12769  * raise MemoryError # <<<<<<<<<<<<<<
12770  * item = tmp
12771  * else:
12772  */
12773  PyErr_NoMemory(); __PYX_ERR(1, 457, __pyx_L1_error)
12774 
12775  /* "View.MemoryView":456
12776  * if <size_t>self.view.itemsize > sizeof(array):
12777  * tmp = PyMem_Malloc(self.view.itemsize)
12778  * if tmp == NULL: # <<<<<<<<<<<<<<
12779  * raise MemoryError
12780  * item = tmp
12781  */
12782  }
12783 
12784  /* "View.MemoryView":458
12785  * if tmp == NULL:
12786  * raise MemoryError
12787  * item = tmp # <<<<<<<<<<<<<<
12788  * else:
12789  * item = <void *> array
12790  */
12791  __pyx_v_item = __pyx_v_tmp;
12792 
12793  /* "View.MemoryView":454
12794  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
12795  *
12796  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
12797  * tmp = PyMem_Malloc(self.view.itemsize)
12798  * if tmp == NULL:
12799  */
12800  goto __pyx_L3;
12801  }
12802 
12803  /* "View.MemoryView":460
12804  * item = tmp
12805  * else:
12806  * item = <void *> array # <<<<<<<<<<<<<<
12807  *
12808  * try:
12809  */
12810  /*else*/ {
12811  __pyx_v_item = ((void *)__pyx_v_array);
12812  }
12813  __pyx_L3:;
12814 
12815  /* "View.MemoryView":462
12816  * item = <void *> array
12817  *
12818  * try: # <<<<<<<<<<<<<<
12819  * if self.dtype_is_object:
12820  * (<PyObject **> item)[0] = <PyObject *> value
12821  */
12822  /*try:*/ {
12823 
12824  /* "View.MemoryView":463
12825  *
12826  * try:
12827  * if self.dtype_is_object: # <<<<<<<<<<<<<<
12828  * (<PyObject **> item)[0] = <PyObject *> value
12829  * else:
12830  */
12831  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
12832  if (__pyx_t_1) {
12833 
12834  /* "View.MemoryView":464
12835  * try:
12836  * if self.dtype_is_object:
12837  * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
12838  * else:
12839  * self.assign_item_from_object(<char *> item, value)
12840  */
12841  (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
12842 
12843  /* "View.MemoryView":463
12844  *
12845  * try:
12846  * if self.dtype_is_object: # <<<<<<<<<<<<<<
12847  * (<PyObject **> item)[0] = <PyObject *> value
12848  * else:
12849  */
12850  goto __pyx_L8;
12851  }
12852 
12853  /* "View.MemoryView":466
12854  * (<PyObject **> item)[0] = <PyObject *> value
12855  * else:
12856  * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
12857  *
12858  *
12859  */
12860  /*else*/ {
12861  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 466, __pyx_L6_error)
12862  __Pyx_GOTREF(__pyx_t_2);
12863  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12864  }
12865  __pyx_L8:;
12866 
12867  /* "View.MemoryView":470
12868  *
12869  *
12870  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
12871  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12872  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12873  */
12874  __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
12875  if (__pyx_t_1) {
12876 
12877  /* "View.MemoryView":471
12878  *
12879  * if self.view.suboffsets != NULL:
12880  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
12881  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12882  * item, self.dtype_is_object)
12883  */
12884  __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 471, __pyx_L6_error)
12885  __Pyx_GOTREF(__pyx_t_2);
12886  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12887 
12888  /* "View.MemoryView":470
12889  *
12890  *
12891  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
12892  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12893  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12894  */
12895  }
12896 
12897  /* "View.MemoryView":472
12898  * if self.view.suboffsets != NULL:
12899  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12900  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
12901  * item, self.dtype_is_object)
12902  * finally:
12903  */
12904  __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
12905  }
12906 
12907  /* "View.MemoryView":475
12908  * item, self.dtype_is_object)
12909  * finally:
12910  * PyMem_Free(tmp) # <<<<<<<<<<<<<<
12911  *
12912  * cdef setitem_indexed(self, index, value):
12913  */
12914  /*finally:*/ {
12915  /*normal exit:*/{
12916  PyMem_Free(__pyx_v_tmp);
12917  goto __pyx_L7;
12918  }
12919  __pyx_L6_error:;
12920  /*exception exit:*/{
12921  __Pyx_PyThreadState_declare
12922  __Pyx_PyThreadState_assign
12923  __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
12924  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12925  if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
12926  if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
12927  __Pyx_XGOTREF(__pyx_t_6);
12928  __Pyx_XGOTREF(__pyx_t_7);
12929  __Pyx_XGOTREF(__pyx_t_8);
12930  __Pyx_XGOTREF(__pyx_t_9);
12931  __Pyx_XGOTREF(__pyx_t_10);
12932  __Pyx_XGOTREF(__pyx_t_11);
12933  __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename;
12934  {
12935  PyMem_Free(__pyx_v_tmp);
12936  }
12937  if (PY_MAJOR_VERSION >= 3) {
12938  __Pyx_XGIVEREF(__pyx_t_9);
12939  __Pyx_XGIVEREF(__pyx_t_10);
12940  __Pyx_XGIVEREF(__pyx_t_11);
12941  __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
12942  }
12943  __Pyx_XGIVEREF(__pyx_t_6);
12944  __Pyx_XGIVEREF(__pyx_t_7);
12945  __Pyx_XGIVEREF(__pyx_t_8);
12946  __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
12947  __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
12948  __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5;
12949  goto __pyx_L1_error;
12950  }
12951  __pyx_L7:;
12952  }
12953 
12954  /* "View.MemoryView":445
12955  * src.ndim, dst.ndim, self.dtype_is_object)
12956  *
12957  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
12958  * cdef int array[128]
12959  * cdef void *tmp = NULL
12960  */
12961 
12962  /* function exit code */
12963  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12964  goto __pyx_L0;
12965  __pyx_L1_error:;
12966  __Pyx_XDECREF(__pyx_t_2);
12967  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
12968  __pyx_r = 0;
12969  __pyx_L0:;
12970  __Pyx_XGIVEREF(__pyx_r);
12971  __Pyx_TraceReturn(__pyx_r, 0);
12972  __Pyx_RefNannyFinishContext();
12973  return __pyx_r;
12974 }
12975 
12976 /* "View.MemoryView":477
12977  * PyMem_Free(tmp)
12978  *
12979  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
12980  * cdef char *itemp = self.get_item_pointer(index)
12981  * self.assign_item_from_object(itemp, value)
12982  */
12983 
12984 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12985  char *__pyx_v_itemp;
12986  PyObject *__pyx_r = NULL;
12987  __Pyx_TraceDeclarations
12988  __Pyx_RefNannyDeclarations
12989  char *__pyx_t_1;
12990  PyObject *__pyx_t_2 = NULL;
12991  __Pyx_RefNannySetupContext("setitem_indexed", 0);
12992  __Pyx_TraceCall("setitem_indexed", __pyx_f[1], 477, 0, __PYX_ERR(1, 477, __pyx_L1_error));
12993 
12994  /* "View.MemoryView":478
12995  *
12996  * cdef setitem_indexed(self, index, value):
12997  * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
12998  * self.assign_item_from_object(itemp, value)
12999  *
13000  */
13001  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 478, __pyx_L1_error)
13002  __pyx_v_itemp = __pyx_t_1;
13003 
13004  /* "View.MemoryView":479
13005  * cdef setitem_indexed(self, index, value):
13006  * cdef char *itemp = self.get_item_pointer(index)
13007  * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
13008  *
13009  * cdef convert_item_to_object(self, char *itemp):
13010  */
13011  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 479, __pyx_L1_error)
13012  __Pyx_GOTREF(__pyx_t_2);
13013  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13014 
13015  /* "View.MemoryView":477
13016  * PyMem_Free(tmp)
13017  *
13018  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
13019  * cdef char *itemp = self.get_item_pointer(index)
13020  * self.assign_item_from_object(itemp, value)
13021  */
13022 
13023  /* function exit code */
13024  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13025  goto __pyx_L0;
13026  __pyx_L1_error:;
13027  __Pyx_XDECREF(__pyx_t_2);
13028  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
13029  __pyx_r = 0;
13030  __pyx_L0:;
13031  __Pyx_XGIVEREF(__pyx_r);
13032  __Pyx_TraceReturn(__pyx_r, 0);
13033  __Pyx_RefNannyFinishContext();
13034  return __pyx_r;
13035 }
13036 
13037 /* "View.MemoryView":481
13038  * self.assign_item_from_object(itemp, value)
13039  *
13040  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
13041  * """Only used if instantiated manually by the user, or if Cython doesn't
13042  * know how to convert the type"""
13043  */
13044 
13045 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
13046  PyObject *__pyx_v_struct = NULL;
13047  PyObject *__pyx_v_bytesitem = 0;
13048  PyObject *__pyx_v_result = NULL;
13049  PyObject *__pyx_r = NULL;
13050  __Pyx_TraceDeclarations
13051  __Pyx_RefNannyDeclarations
13052  PyObject *__pyx_t_1 = NULL;
13053  PyObject *__pyx_t_2 = NULL;
13054  PyObject *__pyx_t_3 = NULL;
13055  PyObject *__pyx_t_4 = NULL;
13056  PyObject *__pyx_t_5 = NULL;
13057  PyObject *__pyx_t_6 = NULL;
13058  PyObject *__pyx_t_7 = NULL;
13059  int __pyx_t_8;
13060  PyObject *__pyx_t_9 = NULL;
13061  size_t __pyx_t_10;
13062  int __pyx_t_11;
13063  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
13064  __Pyx_TraceCall("convert_item_to_object", __pyx_f[1], 481, 0, __PYX_ERR(1, 481, __pyx_L1_error));
13065 
13066  /* "View.MemoryView":484
13067  * """Only used if instantiated manually by the user, or if Cython doesn't
13068  * know how to convert the type"""
13069  * import struct # <<<<<<<<<<<<<<
13070  * cdef bytes bytesitem
13071  *
13072  */
13073  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 484, __pyx_L1_error)
13074  __Pyx_GOTREF(__pyx_t_1);
13075  __pyx_v_struct = __pyx_t_1;
13076  __pyx_t_1 = 0;
13077 
13078  /* "View.MemoryView":487
13079  * cdef bytes bytesitem
13080  *
13081  * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
13082  * try:
13083  * result = struct.unpack(self.view.format, bytesitem)
13084  */
13085  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 487, __pyx_L1_error)
13086  __Pyx_GOTREF(__pyx_t_1);
13087  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
13088  __pyx_t_1 = 0;
13089 
13090  /* "View.MemoryView":488
13091  *
13092  * bytesitem = itemp[:self.view.itemsize]
13093  * try: # <<<<<<<<<<<<<<
13094  * result = struct.unpack(self.view.format, bytesitem)
13095  * except struct.error:
13096  */
13097  {
13098  __Pyx_PyThreadState_declare
13099  __Pyx_PyThreadState_assign
13100  __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
13101  __Pyx_XGOTREF(__pyx_t_2);
13102  __Pyx_XGOTREF(__pyx_t_3);
13103  __Pyx_XGOTREF(__pyx_t_4);
13104  /*try:*/ {
13105 
13106  /* "View.MemoryView":489
13107  * bytesitem = itemp[:self.view.itemsize]
13108  * try:
13109  * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
13110  * except struct.error:
13111  * raise ValueError("Unable to convert item to object")
13112  */
13113  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 489, __pyx_L3_error)
13114  __Pyx_GOTREF(__pyx_t_5);
13115  __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 489, __pyx_L3_error)
13116  __Pyx_GOTREF(__pyx_t_6);
13117  __pyx_t_7 = NULL;
13118  __pyx_t_8 = 0;
13119  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
13120  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
13121  if (likely(__pyx_t_7)) {
13122  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
13123  __Pyx_INCREF(__pyx_t_7);
13124  __Pyx_INCREF(function);
13125  __Pyx_DECREF_SET(__pyx_t_5, function);
13126  __pyx_t_8 = 1;
13127  }
13128  }
13129  #if CYTHON_FAST_PYCALL
13130  if (PyFunction_Check(__pyx_t_5)) {
13131  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
13132  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 489, __pyx_L3_error)
13133  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13134  __Pyx_GOTREF(__pyx_t_1);
13135  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13136  } else
13137  #endif
13138  #if CYTHON_FAST_PYCCALL
13139  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
13140  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
13141  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 489, __pyx_L3_error)
13142  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13143  __Pyx_GOTREF(__pyx_t_1);
13144  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13145  } else
13146  #endif
13147  {
13148  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 489, __pyx_L3_error)
13149  __Pyx_GOTREF(__pyx_t_9);
13150  if (__pyx_t_7) {
13151  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
13152  }
13153  __Pyx_GIVEREF(__pyx_t_6);
13154  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
13155  __Pyx_INCREF(__pyx_v_bytesitem);
13156  __Pyx_GIVEREF(__pyx_v_bytesitem);
13157  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
13158  __pyx_t_6 = 0;
13159  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 489, __pyx_L3_error)
13160  __Pyx_GOTREF(__pyx_t_1);
13161  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13162  }
13163  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13164  __pyx_v_result = __pyx_t_1;
13165  __pyx_t_1 = 0;
13166 
13167  /* "View.MemoryView":488
13168  *
13169  * bytesitem = itemp[:self.view.itemsize]
13170  * try: # <<<<<<<<<<<<<<
13171  * result = struct.unpack(self.view.format, bytesitem)
13172  * except struct.error:
13173  */
13174  }
13175 
13176  /* "View.MemoryView":493
13177  * raise ValueError("Unable to convert item to object")
13178  * else:
13179  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
13180  * return result[0]
13181  * return result
13182  */
13183  /*else:*/ {
13184  __pyx_t_10 = strlen(__pyx_v_self->view.format);
13185  __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
13186  if (__pyx_t_11) {
13187 
13188  /* "View.MemoryView":494
13189  * else:
13190  * if len(self.view.format) == 1:
13191  * return result[0] # <<<<<<<<<<<<<<
13192  * return result
13193  *
13194  */
13195  __Pyx_XDECREF(__pyx_r);
13196  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 494, __pyx_L5_except_error)
13197  __Pyx_GOTREF(__pyx_t_1);
13198  __pyx_r = __pyx_t_1;
13199  __pyx_t_1 = 0;
13200  goto __pyx_L6_except_return;
13201 
13202  /* "View.MemoryView":493
13203  * raise ValueError("Unable to convert item to object")
13204  * else:
13205  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
13206  * return result[0]
13207  * return result
13208  */
13209  }
13210 
13211  /* "View.MemoryView":495
13212  * if len(self.view.format) == 1:
13213  * return result[0]
13214  * return result # <<<<<<<<<<<<<<
13215  *
13216  * cdef assign_item_from_object(self, char *itemp, object value):
13217  */
13218  __Pyx_XDECREF(__pyx_r);
13219  __Pyx_INCREF(__pyx_v_result);
13220  __pyx_r = __pyx_v_result;
13221  goto __pyx_L6_except_return;
13222  }
13223  __pyx_L3_error:;
13224  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13225  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
13226  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
13227  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13228  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
13229 
13230  /* "View.MemoryView":490
13231  * try:
13232  * result = struct.unpack(self.view.format, bytesitem)
13233  * except struct.error: # <<<<<<<<<<<<<<
13234  * raise ValueError("Unable to convert item to object")
13235  * else:
13236  */
13237  __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
13238  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 490, __pyx_L5_except_error)
13239  __Pyx_GOTREF(__pyx_t_6);
13240  __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
13241  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13242  __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
13243  __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
13244  if (__pyx_t_8) {
13245  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
13246  if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 490, __pyx_L5_except_error)
13247  __Pyx_GOTREF(__pyx_t_9);
13248  __Pyx_GOTREF(__pyx_t_5);
13249  __Pyx_GOTREF(__pyx_t_1);
13250 
13251  /* "View.MemoryView":491
13252  * result = struct.unpack(self.view.format, bytesitem)
13253  * except struct.error:
13254  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
13255  * else:
13256  * if len(self.view.format) == 1:
13257  */
13258  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 491, __pyx_L5_except_error)
13259  __Pyx_GOTREF(__pyx_t_6);
13260  __Pyx_Raise(__pyx_t_6, 0, 0, 0);
13261  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13262  __PYX_ERR(1, 491, __pyx_L5_except_error)
13263  }
13264  goto __pyx_L5_except_error;
13265  __pyx_L5_except_error:;
13266 
13267  /* "View.MemoryView":488
13268  *
13269  * bytesitem = itemp[:self.view.itemsize]
13270  * try: # <<<<<<<<<<<<<<
13271  * result = struct.unpack(self.view.format, bytesitem)
13272  * except struct.error:
13273  */
13274  __Pyx_XGIVEREF(__pyx_t_2);
13275  __Pyx_XGIVEREF(__pyx_t_3);
13276  __Pyx_XGIVEREF(__pyx_t_4);
13277  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
13278  goto __pyx_L1_error;
13279  __pyx_L6_except_return:;
13280  __Pyx_XGIVEREF(__pyx_t_2);
13281  __Pyx_XGIVEREF(__pyx_t_3);
13282  __Pyx_XGIVEREF(__pyx_t_4);
13283  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
13284  goto __pyx_L0;
13285  }
13286 
13287  /* "View.MemoryView":481
13288  * self.assign_item_from_object(itemp, value)
13289  *
13290  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
13291  * """Only used if instantiated manually by the user, or if Cython doesn't
13292  * know how to convert the type"""
13293  */
13294 
13295  /* function exit code */
13296  __pyx_L1_error:;
13297  __Pyx_XDECREF(__pyx_t_1);
13298  __Pyx_XDECREF(__pyx_t_5);
13299  __Pyx_XDECREF(__pyx_t_6);
13300  __Pyx_XDECREF(__pyx_t_7);
13301  __Pyx_XDECREF(__pyx_t_9);
13302  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
13303  __pyx_r = 0;
13304  __pyx_L0:;
13305  __Pyx_XDECREF(__pyx_v_struct);
13306  __Pyx_XDECREF(__pyx_v_bytesitem);
13307  __Pyx_XDECREF(__pyx_v_result);
13308  __Pyx_XGIVEREF(__pyx_r);
13309  __Pyx_TraceReturn(__pyx_r, 0);
13310  __Pyx_RefNannyFinishContext();
13311  return __pyx_r;
13312 }
13313 
13314 /* "View.MemoryView":497
13315  * return result
13316  *
13317  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
13318  * """Only used if instantiated manually by the user, or if Cython doesn't
13319  * know how to convert the type"""
13320  */
13321 
13322 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
13323  PyObject *__pyx_v_struct = NULL;
13324  char __pyx_v_c;
13325  PyObject *__pyx_v_bytesvalue = 0;
13326  Py_ssize_t __pyx_v_i;
13327  PyObject *__pyx_r = NULL;
13328  __Pyx_TraceDeclarations
13329  __Pyx_RefNannyDeclarations
13330  PyObject *__pyx_t_1 = NULL;
13331  int __pyx_t_2;
13332  int __pyx_t_3;
13333  PyObject *__pyx_t_4 = NULL;
13334  PyObject *__pyx_t_5 = NULL;
13335  PyObject *__pyx_t_6 = NULL;
13336  int __pyx_t_7;
13337  PyObject *__pyx_t_8 = NULL;
13338  Py_ssize_t __pyx_t_9;
13339  PyObject *__pyx_t_10 = NULL;
13340  char *__pyx_t_11;
13341  char *__pyx_t_12;
13342  char *__pyx_t_13;
13343  char *__pyx_t_14;
13344  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
13345  __Pyx_TraceCall("assign_item_from_object", __pyx_f[1], 497, 0, __PYX_ERR(1, 497, __pyx_L1_error));
13346 
13347  /* "View.MemoryView":500
13348  * """Only used if instantiated manually by the user, or if Cython doesn't
13349  * know how to convert the type"""
13350  * import struct # <<<<<<<<<<<<<<
13351  * cdef char c
13352  * cdef bytes bytesvalue
13353  */
13354  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 500, __pyx_L1_error)
13355  __Pyx_GOTREF(__pyx_t_1);
13356  __pyx_v_struct = __pyx_t_1;
13357  __pyx_t_1 = 0;
13358 
13359  /* "View.MemoryView":505
13360  * cdef Py_ssize_t i
13361  *
13362  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
13363  * bytesvalue = struct.pack(self.view.format, *value)
13364  * else:
13365  */
13366  __pyx_t_2 = PyTuple_Check(__pyx_v_value);
13367  __pyx_t_3 = (__pyx_t_2 != 0);
13368  if (__pyx_t_3) {
13369 
13370  /* "View.MemoryView":506
13371  *
13372  * if isinstance(value, tuple):
13373  * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
13374  * else:
13375  * bytesvalue = struct.pack(self.view.format, value)
13376  */
13377  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 506, __pyx_L1_error)
13378  __Pyx_GOTREF(__pyx_t_1);
13379  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 506, __pyx_L1_error)
13380  __Pyx_GOTREF(__pyx_t_4);
13381  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 506, __pyx_L1_error)
13382  __Pyx_GOTREF(__pyx_t_5);
13383  __Pyx_GIVEREF(__pyx_t_4);
13384  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
13385  __pyx_t_4 = 0;
13386  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 506, __pyx_L1_error)
13387  __Pyx_GOTREF(__pyx_t_4);
13388  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 506, __pyx_L1_error)
13389  __Pyx_GOTREF(__pyx_t_6);
13390  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13391  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13392  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 506, __pyx_L1_error)
13393  __Pyx_GOTREF(__pyx_t_4);
13394  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13395  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13396  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 506, __pyx_L1_error)
13397  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
13398  __pyx_t_4 = 0;
13399 
13400  /* "View.MemoryView":505
13401  * cdef Py_ssize_t i
13402  *
13403  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
13404  * bytesvalue = struct.pack(self.view.format, *value)
13405  * else:
13406  */
13407  goto __pyx_L3;
13408  }
13409 
13410  /* "View.MemoryView":508
13411  * bytesvalue = struct.pack(self.view.format, *value)
13412  * else:
13413  * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
13414  *
13415  * for i, c in enumerate(bytesvalue):
13416  */
13417  /*else*/ {
13418  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 508, __pyx_L1_error)
13419  __Pyx_GOTREF(__pyx_t_6);
13420  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 508, __pyx_L1_error)
13421  __Pyx_GOTREF(__pyx_t_1);
13422  __pyx_t_5 = NULL;
13423  __pyx_t_7 = 0;
13424  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
13425  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
13426  if (likely(__pyx_t_5)) {
13427  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
13428  __Pyx_INCREF(__pyx_t_5);
13429  __Pyx_INCREF(function);
13430  __Pyx_DECREF_SET(__pyx_t_6, function);
13431  __pyx_t_7 = 1;
13432  }
13433  }
13434  #if CYTHON_FAST_PYCALL
13435  if (PyFunction_Check(__pyx_t_6)) {
13436  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
13437  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 508, __pyx_L1_error)
13438  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13439  __Pyx_GOTREF(__pyx_t_4);
13440  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13441  } else
13442  #endif
13443  #if CYTHON_FAST_PYCCALL
13444  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
13445  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
13446  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 508, __pyx_L1_error)
13447  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13448  __Pyx_GOTREF(__pyx_t_4);
13449  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13450  } else
13451  #endif
13452  {
13453  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 508, __pyx_L1_error)
13454  __Pyx_GOTREF(__pyx_t_8);
13455  if (__pyx_t_5) {
13456  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
13457  }
13458  __Pyx_GIVEREF(__pyx_t_1);
13459  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
13460  __Pyx_INCREF(__pyx_v_value);
13461  __Pyx_GIVEREF(__pyx_v_value);
13462  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
13463  __pyx_t_1 = 0;
13464  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 508, __pyx_L1_error)
13465  __Pyx_GOTREF(__pyx_t_4);
13466  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13467  }
13468  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13469  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 508, __pyx_L1_error)
13470  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
13471  __pyx_t_4 = 0;
13472  }
13473  __pyx_L3:;
13474 
13475  /* "View.MemoryView":510
13476  * bytesvalue = struct.pack(self.view.format, value)
13477  *
13478  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
13479  * itemp[i] = c
13480  *
13481  */
13482  __pyx_t_9 = 0;
13483  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
13484  PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
13485  __PYX_ERR(1, 510, __pyx_L1_error)
13486  }
13487  __Pyx_INCREF(__pyx_v_bytesvalue);
13488  __pyx_t_10 = __pyx_v_bytesvalue;
13489  __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
13490  __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
13491  for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
13492  __pyx_t_11 = __pyx_t_14;
13493  __pyx_v_c = (__pyx_t_11[0]);
13494 
13495  /* "View.MemoryView":511
13496  *
13497  * for i, c in enumerate(bytesvalue):
13498  * itemp[i] = c # <<<<<<<<<<<<<<
13499  *
13500  * @cname('getbuffer')
13501  */
13502  __pyx_v_i = __pyx_t_9;
13503 
13504  /* "View.MemoryView":510
13505  * bytesvalue = struct.pack(self.view.format, value)
13506  *
13507  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
13508  * itemp[i] = c
13509  *
13510  */
13511  __pyx_t_9 = (__pyx_t_9 + 1);
13512 
13513  /* "View.MemoryView":511
13514  *
13515  * for i, c in enumerate(bytesvalue):
13516  * itemp[i] = c # <<<<<<<<<<<<<<
13517  *
13518  * @cname('getbuffer')
13519  */
13520  (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
13521  }
13522  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13523 
13524  /* "View.MemoryView":497
13525  * return result
13526  *
13527  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
13528  * """Only used if instantiated manually by the user, or if Cython doesn't
13529  * know how to convert the type"""
13530  */
13531 
13532  /* function exit code */
13533  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13534  goto __pyx_L0;
13535  __pyx_L1_error:;
13536  __Pyx_XDECREF(__pyx_t_1);
13537  __Pyx_XDECREF(__pyx_t_4);
13538  __Pyx_XDECREF(__pyx_t_5);
13539  __Pyx_XDECREF(__pyx_t_6);
13540  __Pyx_XDECREF(__pyx_t_8);
13541  __Pyx_XDECREF(__pyx_t_10);
13542  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
13543  __pyx_r = 0;
13544  __pyx_L0:;
13545  __Pyx_XDECREF(__pyx_v_struct);
13546  __Pyx_XDECREF(__pyx_v_bytesvalue);
13547  __Pyx_XGIVEREF(__pyx_r);
13548  __Pyx_TraceReturn(__pyx_r, 0);
13549  __Pyx_RefNannyFinishContext();
13550  return __pyx_r;
13551 }
13552 
13553 /* "View.MemoryView":514
13554  *
13555  * @cname('getbuffer')
13556  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
13557  * if flags & PyBUF_WRITABLE and self.view.readonly:
13558  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13559  */
13560 
13561 /* Python wrapper */
13562 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
13563 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
13564  int __pyx_r;
13565  __Pyx_RefNannyDeclarations
13566  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
13567  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
13568 
13569  /* function exit code */
13570  __Pyx_RefNannyFinishContext();
13571  return __pyx_r;
13572 }
13573 
13574 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
13575  int __pyx_r;
13576  __Pyx_TraceDeclarations
13577  __Pyx_RefNannyDeclarations
13578  int __pyx_t_1;
13579  int __pyx_t_2;
13580  PyObject *__pyx_t_3 = NULL;
13581  Py_ssize_t *__pyx_t_4;
13582  char *__pyx_t_5;
13583  void *__pyx_t_6;
13584  int __pyx_t_7;
13585  Py_ssize_t __pyx_t_8;
13586  if (__pyx_v_info == NULL) {
13587  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
13588  return -1;
13589  }
13590  __Pyx_RefNannySetupContext("__getbuffer__", 0);
13591  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
13592  __Pyx_GIVEREF(__pyx_v_info->obj);
13593  __Pyx_TraceCall("__getbuffer__", __pyx_f[1], 514, 0, __PYX_ERR(1, 514, __pyx_L1_error));
13594 
13595  /* "View.MemoryView":515
13596  * @cname('getbuffer')
13597  * def __getbuffer__(self, Py_buffer *info, int flags):
13598  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
13599  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13600  *
13601  */
13602  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
13603  if (__pyx_t_2) {
13604  } else {
13605  __pyx_t_1 = __pyx_t_2;
13606  goto __pyx_L4_bool_binop_done;
13607  }
13608  __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
13609  __pyx_t_1 = __pyx_t_2;
13610  __pyx_L4_bool_binop_done:;
13611  if (unlikely(__pyx_t_1)) {
13612 
13613  /* "View.MemoryView":516
13614  * def __getbuffer__(self, Py_buffer *info, int flags):
13615  * if flags & PyBUF_WRITABLE and self.view.readonly:
13616  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
13617  *
13618  * if flags & PyBUF_ND:
13619  */
13620  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 516, __pyx_L1_error)
13621  __Pyx_GOTREF(__pyx_t_3);
13622  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
13623  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13624  __PYX_ERR(1, 516, __pyx_L1_error)
13625 
13626  /* "View.MemoryView":515
13627  * @cname('getbuffer')
13628  * def __getbuffer__(self, Py_buffer *info, int flags):
13629  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
13630  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13631  *
13632  */
13633  }
13634 
13635  /* "View.MemoryView":518
13636  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13637  *
13638  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
13639  * info.shape = self.view.shape
13640  * else:
13641  */
13642  __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
13643  if (__pyx_t_1) {
13644 
13645  /* "View.MemoryView":519
13646  *
13647  * if flags & PyBUF_ND:
13648  * info.shape = self.view.shape # <<<<<<<<<<<<<<
13649  * else:
13650  * info.shape = NULL
13651  */
13652  __pyx_t_4 = __pyx_v_self->view.shape;
13653  __pyx_v_info->shape = __pyx_t_4;
13654 
13655  /* "View.MemoryView":518
13656  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13657  *
13658  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
13659  * info.shape = self.view.shape
13660  * else:
13661  */
13662  goto __pyx_L6;
13663  }
13664 
13665  /* "View.MemoryView":521
13666  * info.shape = self.view.shape
13667  * else:
13668  * info.shape = NULL # <<<<<<<<<<<<<<
13669  *
13670  * if flags & PyBUF_STRIDES:
13671  */
13672  /*else*/ {
13673  __pyx_v_info->shape = NULL;
13674  }
13675  __pyx_L6:;
13676 
13677  /* "View.MemoryView":523
13678  * info.shape = NULL
13679  *
13680  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
13681  * info.strides = self.view.strides
13682  * else:
13683  */
13684  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
13685  if (__pyx_t_1) {
13686 
13687  /* "View.MemoryView":524
13688  *
13689  * if flags & PyBUF_STRIDES:
13690  * info.strides = self.view.strides # <<<<<<<<<<<<<<
13691  * else:
13692  * info.strides = NULL
13693  */
13694  __pyx_t_4 = __pyx_v_self->view.strides;
13695  __pyx_v_info->strides = __pyx_t_4;
13696 
13697  /* "View.MemoryView":523
13698  * info.shape = NULL
13699  *
13700  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
13701  * info.strides = self.view.strides
13702  * else:
13703  */
13704  goto __pyx_L7;
13705  }
13706 
13707  /* "View.MemoryView":526
13708  * info.strides = self.view.strides
13709  * else:
13710  * info.strides = NULL # <<<<<<<<<<<<<<
13711  *
13712  * if flags & PyBUF_INDIRECT:
13713  */
13714  /*else*/ {
13715  __pyx_v_info->strides = NULL;
13716  }
13717  __pyx_L7:;
13718 
13719  /* "View.MemoryView":528
13720  * info.strides = NULL
13721  *
13722  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
13723  * info.suboffsets = self.view.suboffsets
13724  * else:
13725  */
13726  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
13727  if (__pyx_t_1) {
13728 
13729  /* "View.MemoryView":529
13730  *
13731  * if flags & PyBUF_INDIRECT:
13732  * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
13733  * else:
13734  * info.suboffsets = NULL
13735  */
13736  __pyx_t_4 = __pyx_v_self->view.suboffsets;
13737  __pyx_v_info->suboffsets = __pyx_t_4;
13738 
13739  /* "View.MemoryView":528
13740  * info.strides = NULL
13741  *
13742  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
13743  * info.suboffsets = self.view.suboffsets
13744  * else:
13745  */
13746  goto __pyx_L8;
13747  }
13748 
13749  /* "View.MemoryView":531
13750  * info.suboffsets = self.view.suboffsets
13751  * else:
13752  * info.suboffsets = NULL # <<<<<<<<<<<<<<
13753  *
13754  * if flags & PyBUF_FORMAT:
13755  */
13756  /*else*/ {
13757  __pyx_v_info->suboffsets = NULL;
13758  }
13759  __pyx_L8:;
13760 
13761  /* "View.MemoryView":533
13762  * info.suboffsets = NULL
13763  *
13764  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
13765  * info.format = self.view.format
13766  * else:
13767  */
13768  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
13769  if (__pyx_t_1) {
13770 
13771  /* "View.MemoryView":534
13772  *
13773  * if flags & PyBUF_FORMAT:
13774  * info.format = self.view.format # <<<<<<<<<<<<<<
13775  * else:
13776  * info.format = NULL
13777  */
13778  __pyx_t_5 = __pyx_v_self->view.format;
13779  __pyx_v_info->format = __pyx_t_5;
13780 
13781  /* "View.MemoryView":533
13782  * info.suboffsets = NULL
13783  *
13784  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
13785  * info.format = self.view.format
13786  * else:
13787  */
13788  goto __pyx_L9;
13789  }
13790 
13791  /* "View.MemoryView":536
13792  * info.format = self.view.format
13793  * else:
13794  * info.format = NULL # <<<<<<<<<<<<<<
13795  *
13796  * info.buf = self.view.buf
13797  */
13798  /*else*/ {
13799  __pyx_v_info->format = NULL;
13800  }
13801  __pyx_L9:;
13802 
13803  /* "View.MemoryView":538
13804  * info.format = NULL
13805  *
13806  * info.buf = self.view.buf # <<<<<<<<<<<<<<
13807  * info.ndim = self.view.ndim
13808  * info.itemsize = self.view.itemsize
13809  */
13810  __pyx_t_6 = __pyx_v_self->view.buf;
13811  __pyx_v_info->buf = __pyx_t_6;
13812 
13813  /* "View.MemoryView":539
13814  *
13815  * info.buf = self.view.buf
13816  * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
13817  * info.itemsize = self.view.itemsize
13818  * info.len = self.view.len
13819  */
13820  __pyx_t_7 = __pyx_v_self->view.ndim;
13821  __pyx_v_info->ndim = __pyx_t_7;
13822 
13823  /* "View.MemoryView":540
13824  * info.buf = self.view.buf
13825  * info.ndim = self.view.ndim
13826  * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
13827  * info.len = self.view.len
13828  * info.readonly = self.view.readonly
13829  */
13830  __pyx_t_8 = __pyx_v_self->view.itemsize;
13831  __pyx_v_info->itemsize = __pyx_t_8;
13832 
13833  /* "View.MemoryView":541
13834  * info.ndim = self.view.ndim
13835  * info.itemsize = self.view.itemsize
13836  * info.len = self.view.len # <<<<<<<<<<<<<<
13837  * info.readonly = self.view.readonly
13838  * info.obj = self
13839  */
13840  __pyx_t_8 = __pyx_v_self->view.len;
13841  __pyx_v_info->len = __pyx_t_8;
13842 
13843  /* "View.MemoryView":542
13844  * info.itemsize = self.view.itemsize
13845  * info.len = self.view.len
13846  * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
13847  * info.obj = self
13848  *
13849  */
13850  __pyx_t_1 = __pyx_v_self->view.readonly;
13851  __pyx_v_info->readonly = __pyx_t_1;
13852 
13853  /* "View.MemoryView":543
13854  * info.len = self.view.len
13855  * info.readonly = self.view.readonly
13856  * info.obj = self # <<<<<<<<<<<<<<
13857  *
13858  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
13859  */
13860  __Pyx_INCREF(((PyObject *)__pyx_v_self));
13861  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
13862  __Pyx_GOTREF(__pyx_v_info->obj);
13863  __Pyx_DECREF(__pyx_v_info->obj);
13864  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
13865 
13866  /* "View.MemoryView":514
13867  *
13868  * @cname('getbuffer')
13869  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
13870  * if flags & PyBUF_WRITABLE and self.view.readonly:
13871  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13872  */
13873 
13874  /* function exit code */
13875  __pyx_r = 0;
13876  goto __pyx_L0;
13877  __pyx_L1_error:;
13878  __Pyx_XDECREF(__pyx_t_3);
13879  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13880  __pyx_r = -1;
13881  if (__pyx_v_info->obj != NULL) {
13882  __Pyx_GOTREF(__pyx_v_info->obj);
13883  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13884  }
13885  goto __pyx_L2;
13886  __pyx_L0:;
13887  if (__pyx_v_info->obj == Py_None) {
13888  __Pyx_GOTREF(__pyx_v_info->obj);
13889  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13890  }
13891  __pyx_L2:;
13892  __Pyx_TraceReturn(Py_None, 0);
13893  __Pyx_RefNannyFinishContext();
13894  return __pyx_r;
13895 }
13896 
13897 /* "View.MemoryView":549
13898  *
13899  * @property
13900  * def T(self): # <<<<<<<<<<<<<<
13901  * cdef _memoryviewslice result = memoryview_copy(self)
13902  * transpose_memslice(&result.from_slice)
13903  */
13904 
13905 /* Python wrapper */
13906 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
13907 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
13908  PyObject *__pyx_r = 0;
13909  __Pyx_RefNannyDeclarations
13910  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13911  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13912 
13913  /* function exit code */
13914  __Pyx_RefNannyFinishContext();
13915  return __pyx_r;
13916 }
13917 
13918 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13919  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
13920  PyObject *__pyx_r = NULL;
13921  __Pyx_TraceDeclarations
13922  __Pyx_RefNannyDeclarations
13923  PyObject *__pyx_t_1 = NULL;
13924  int __pyx_t_2;
13925  __Pyx_RefNannySetupContext("__get__", 0);
13926  __Pyx_TraceCall("__get__", __pyx_f[1], 549, 0, __PYX_ERR(1, 549, __pyx_L1_error));
13927 
13928  /* "View.MemoryView":550
13929  * @property
13930  * def T(self):
13931  * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
13932  * transpose_memslice(&result.from_slice)
13933  * return result
13934  */
13935  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 550, __pyx_L1_error)
13936  __Pyx_GOTREF(__pyx_t_1);
13937  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 550, __pyx_L1_error)
13938  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
13939  __pyx_t_1 = 0;
13940 
13941  /* "View.MemoryView":551
13942  * def T(self):
13943  * cdef _memoryviewslice result = memoryview_copy(self)
13944  * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
13945  * return result
13946  *
13947  */
13948  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 551, __pyx_L1_error)
13949 
13950  /* "View.MemoryView":552
13951  * cdef _memoryviewslice result = memoryview_copy(self)
13952  * transpose_memslice(&result.from_slice)
13953  * return result # <<<<<<<<<<<<<<
13954  *
13955  * @property
13956  */
13957  __Pyx_XDECREF(__pyx_r);
13958  __Pyx_INCREF(((PyObject *)__pyx_v_result));
13959  __pyx_r = ((PyObject *)__pyx_v_result);
13960  goto __pyx_L0;
13961 
13962  /* "View.MemoryView":549
13963  *
13964  * @property
13965  * def T(self): # <<<<<<<<<<<<<<
13966  * cdef _memoryviewslice result = memoryview_copy(self)
13967  * transpose_memslice(&result.from_slice)
13968  */
13969 
13970  /* function exit code */
13971  __pyx_L1_error:;
13972  __Pyx_XDECREF(__pyx_t_1);
13973  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13974  __pyx_r = NULL;
13975  __pyx_L0:;
13976  __Pyx_XDECREF((PyObject *)__pyx_v_result);
13977  __Pyx_XGIVEREF(__pyx_r);
13978  __Pyx_TraceReturn(__pyx_r, 0);
13979  __Pyx_RefNannyFinishContext();
13980  return __pyx_r;
13981 }
13982 
13983 /* "View.MemoryView":555
13984  *
13985  * @property
13986  * def base(self): # <<<<<<<<<<<<<<
13987  * return self.obj
13988  *
13989  */
13990 
13991 /* Python wrapper */
13992 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
13993 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
13994  PyObject *__pyx_r = 0;
13995  __Pyx_RefNannyDeclarations
13996  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13997  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13998 
13999  /* function exit code */
14000  __Pyx_RefNannyFinishContext();
14001  return __pyx_r;
14002 }
14003 
14004 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14005  PyObject *__pyx_r = NULL;
14006  __Pyx_TraceDeclarations
14007  __Pyx_RefNannyDeclarations
14008  __Pyx_RefNannySetupContext("__get__", 0);
14009  __Pyx_TraceCall("__get__", __pyx_f[1], 555, 0, __PYX_ERR(1, 555, __pyx_L1_error));
14010 
14011  /* "View.MemoryView":556
14012  * @property
14013  * def base(self):
14014  * return self.obj # <<<<<<<<<<<<<<
14015  *
14016  * @property
14017  */
14018  __Pyx_XDECREF(__pyx_r);
14019  __Pyx_INCREF(__pyx_v_self->obj);
14020  __pyx_r = __pyx_v_self->obj;
14021  goto __pyx_L0;
14022 
14023  /* "View.MemoryView":555
14024  *
14025  * @property
14026  * def base(self): # <<<<<<<<<<<<<<
14027  * return self.obj
14028  *
14029  */
14030 
14031  /* function exit code */
14032  __pyx_L1_error:;
14033  __Pyx_AddTraceback("View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14034  __pyx_r = NULL;
14035  __pyx_L0:;
14036  __Pyx_XGIVEREF(__pyx_r);
14037  __Pyx_TraceReturn(__pyx_r, 0);
14038  __Pyx_RefNannyFinishContext();
14039  return __pyx_r;
14040 }
14041 
14042 /* "View.MemoryView":559
14043  *
14044  * @property
14045  * def shape(self): # <<<<<<<<<<<<<<
14046  * return tuple([length for length in self.view.shape[:self.view.ndim]])
14047  *
14048  */
14049 
14050 /* Python wrapper */
14051 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
14052 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
14053  PyObject *__pyx_r = 0;
14054  __Pyx_RefNannyDeclarations
14055  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14056  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14057 
14058  /* function exit code */
14059  __Pyx_RefNannyFinishContext();
14060  return __pyx_r;
14061 }
14062 
14063 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14064  Py_ssize_t __pyx_v_length;
14065  PyObject *__pyx_r = NULL;
14066  __Pyx_TraceDeclarations
14067  __Pyx_RefNannyDeclarations
14068  PyObject *__pyx_t_1 = NULL;
14069  Py_ssize_t *__pyx_t_2;
14070  Py_ssize_t *__pyx_t_3;
14071  Py_ssize_t *__pyx_t_4;
14072  PyObject *__pyx_t_5 = NULL;
14073  __Pyx_RefNannySetupContext("__get__", 0);
14074  __Pyx_TraceCall("__get__", __pyx_f[1], 559, 0, __PYX_ERR(1, 559, __pyx_L1_error));
14075 
14076  /* "View.MemoryView":560
14077  * @property
14078  * def shape(self):
14079  * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
14080  *
14081  * @property
14082  */
14083  __Pyx_XDECREF(__pyx_r);
14084  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 560, __pyx_L1_error)
14085  __Pyx_GOTREF(__pyx_t_1);
14086  __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
14087  for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
14088  __pyx_t_2 = __pyx_t_4;
14089  __pyx_v_length = (__pyx_t_2[0]);
14090  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 560, __pyx_L1_error)
14091  __Pyx_GOTREF(__pyx_t_5);
14092  if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 560, __pyx_L1_error)
14093  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14094  }
14095  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 560, __pyx_L1_error)
14096  __Pyx_GOTREF(__pyx_t_5);
14097  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14098  __pyx_r = __pyx_t_5;
14099  __pyx_t_5 = 0;
14100  goto __pyx_L0;
14101 
14102  /* "View.MemoryView":559
14103  *
14104  * @property
14105  * def shape(self): # <<<<<<<<<<<<<<
14106  * return tuple([length for length in self.view.shape[:self.view.ndim]])
14107  *
14108  */
14109 
14110  /* function exit code */
14111  __pyx_L1_error:;
14112  __Pyx_XDECREF(__pyx_t_1);
14113  __Pyx_XDECREF(__pyx_t_5);
14114  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14115  __pyx_r = NULL;
14116  __pyx_L0:;
14117  __Pyx_XGIVEREF(__pyx_r);
14118  __Pyx_TraceReturn(__pyx_r, 0);
14119  __Pyx_RefNannyFinishContext();
14120  return __pyx_r;
14121 }
14122 
14123 /* "View.MemoryView":563
14124  *
14125  * @property
14126  * def strides(self): # <<<<<<<<<<<<<<
14127  * if self.view.strides == NULL:
14128  *
14129  */
14130 
14131 /* Python wrapper */
14132 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
14133 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
14134  PyObject *__pyx_r = 0;
14135  __Pyx_RefNannyDeclarations
14136  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14137  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14138 
14139  /* function exit code */
14140  __Pyx_RefNannyFinishContext();
14141  return __pyx_r;
14142 }
14143 
14144 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14145  Py_ssize_t __pyx_v_stride;
14146  PyObject *__pyx_r = NULL;
14147  __Pyx_TraceDeclarations
14148  __Pyx_RefNannyDeclarations
14149  int __pyx_t_1;
14150  PyObject *__pyx_t_2 = NULL;
14151  Py_ssize_t *__pyx_t_3;
14152  Py_ssize_t *__pyx_t_4;
14153  Py_ssize_t *__pyx_t_5;
14154  PyObject *__pyx_t_6 = NULL;
14155  __Pyx_RefNannySetupContext("__get__", 0);
14156  __Pyx_TraceCall("__get__", __pyx_f[1], 563, 0, __PYX_ERR(1, 563, __pyx_L1_error));
14157 
14158  /* "View.MemoryView":564
14159  * @property
14160  * def strides(self):
14161  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
14162  *
14163  * raise ValueError("Buffer view does not expose strides")
14164  */
14165  __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
14166  if (unlikely(__pyx_t_1)) {
14167 
14168  /* "View.MemoryView":566
14169  * if self.view.strides == NULL:
14170  *
14171  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
14172  *
14173  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
14174  */
14175  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 566, __pyx_L1_error)
14176  __Pyx_GOTREF(__pyx_t_2);
14177  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
14178  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14179  __PYX_ERR(1, 566, __pyx_L1_error)
14180 
14181  /* "View.MemoryView":564
14182  * @property
14183  * def strides(self):
14184  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
14185  *
14186  * raise ValueError("Buffer view does not expose strides")
14187  */
14188  }
14189 
14190  /* "View.MemoryView":568
14191  * raise ValueError("Buffer view does not expose strides")
14192  *
14193  * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
14194  *
14195  * @property
14196  */
14197  __Pyx_XDECREF(__pyx_r);
14198  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 568, __pyx_L1_error)
14199  __Pyx_GOTREF(__pyx_t_2);
14200  __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
14201  for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
14202  __pyx_t_3 = __pyx_t_5;
14203  __pyx_v_stride = (__pyx_t_3[0]);
14204  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 568, __pyx_L1_error)
14205  __Pyx_GOTREF(__pyx_t_6);
14206  if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 568, __pyx_L1_error)
14207  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14208  }
14209  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 568, __pyx_L1_error)
14210  __Pyx_GOTREF(__pyx_t_6);
14211  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14212  __pyx_r = __pyx_t_6;
14213  __pyx_t_6 = 0;
14214  goto __pyx_L0;
14215 
14216  /* "View.MemoryView":563
14217  *
14218  * @property
14219  * def strides(self): # <<<<<<<<<<<<<<
14220  * if self.view.strides == NULL:
14221  *
14222  */
14223 
14224  /* function exit code */
14225  __pyx_L1_error:;
14226  __Pyx_XDECREF(__pyx_t_2);
14227  __Pyx_XDECREF(__pyx_t_6);
14228  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14229  __pyx_r = NULL;
14230  __pyx_L0:;
14231  __Pyx_XGIVEREF(__pyx_r);
14232  __Pyx_TraceReturn(__pyx_r, 0);
14233  __Pyx_RefNannyFinishContext();
14234  return __pyx_r;
14235 }
14236 
14237 /* "View.MemoryView":571
14238  *
14239  * @property
14240  * def suboffsets(self): # <<<<<<<<<<<<<<
14241  * if self.view.suboffsets == NULL:
14242  * return (-1,) * self.view.ndim
14243  */
14244 
14245 /* Python wrapper */
14246 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
14247 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
14248  PyObject *__pyx_r = 0;
14249  __Pyx_RefNannyDeclarations
14250  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14251  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14252 
14253  /* function exit code */
14254  __Pyx_RefNannyFinishContext();
14255  return __pyx_r;
14256 }
14257 
14258 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14259  Py_ssize_t __pyx_v_suboffset;
14260  PyObject *__pyx_r = NULL;
14261  __Pyx_TraceDeclarations
14262  __Pyx_RefNannyDeclarations
14263  int __pyx_t_1;
14264  PyObject *__pyx_t_2 = NULL;
14265  PyObject *__pyx_t_3 = NULL;
14266  Py_ssize_t *__pyx_t_4;
14267  Py_ssize_t *__pyx_t_5;
14268  Py_ssize_t *__pyx_t_6;
14269  __Pyx_RefNannySetupContext("__get__", 0);
14270  __Pyx_TraceCall("__get__", __pyx_f[1], 571, 0, __PYX_ERR(1, 571, __pyx_L1_error));
14271 
14272  /* "View.MemoryView":572
14273  * @property
14274  * def suboffsets(self):
14275  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
14276  * return (-1,) * self.view.ndim
14277  *
14278  */
14279  __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
14280  if (__pyx_t_1) {
14281 
14282  /* "View.MemoryView":573
14283  * def suboffsets(self):
14284  * if self.view.suboffsets == NULL:
14285  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
14286  *
14287  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
14288  */
14289  __Pyx_XDECREF(__pyx_r);
14290  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 573, __pyx_L1_error)
14291  __Pyx_GOTREF(__pyx_t_2);
14292  __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__33, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 573, __pyx_L1_error)
14293  __Pyx_GOTREF(__pyx_t_3);
14294  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14295  __pyx_r = __pyx_t_3;
14296  __pyx_t_3 = 0;
14297  goto __pyx_L0;
14298 
14299  /* "View.MemoryView":572
14300  * @property
14301  * def suboffsets(self):
14302  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
14303  * return (-1,) * self.view.ndim
14304  *
14305  */
14306  }
14307 
14308  /* "View.MemoryView":575
14309  * return (-1,) * self.view.ndim
14310  *
14311  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
14312  *
14313  * @property
14314  */
14315  __Pyx_XDECREF(__pyx_r);
14316  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 575, __pyx_L1_error)
14317  __Pyx_GOTREF(__pyx_t_3);
14318  __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
14319  for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
14320  __pyx_t_4 = __pyx_t_6;
14321  __pyx_v_suboffset = (__pyx_t_4[0]);
14322  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 575, __pyx_L1_error)
14323  __Pyx_GOTREF(__pyx_t_2);
14324  if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 575, __pyx_L1_error)
14325  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14326  }
14327  __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 575, __pyx_L1_error)
14328  __Pyx_GOTREF(__pyx_t_2);
14329  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14330  __pyx_r = __pyx_t_2;
14331  __pyx_t_2 = 0;
14332  goto __pyx_L0;
14333 
14334  /* "View.MemoryView":571
14335  *
14336  * @property
14337  * def suboffsets(self): # <<<<<<<<<<<<<<
14338  * if self.view.suboffsets == NULL:
14339  * return (-1,) * self.view.ndim
14340  */
14341 
14342  /* function exit code */
14343  __pyx_L1_error:;
14344  __Pyx_XDECREF(__pyx_t_2);
14345  __Pyx_XDECREF(__pyx_t_3);
14346  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14347  __pyx_r = NULL;
14348  __pyx_L0:;
14349  __Pyx_XGIVEREF(__pyx_r);
14350  __Pyx_TraceReturn(__pyx_r, 0);
14351  __Pyx_RefNannyFinishContext();
14352  return __pyx_r;
14353 }
14354 
14355 /* "View.MemoryView":578
14356  *
14357  * @property
14358  * def ndim(self): # <<<<<<<<<<<<<<
14359  * return self.view.ndim
14360  *
14361  */
14362 
14363 /* Python wrapper */
14364 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
14365 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
14366  PyObject *__pyx_r = 0;
14367  __Pyx_RefNannyDeclarations
14368  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14369  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14370 
14371  /* function exit code */
14372  __Pyx_RefNannyFinishContext();
14373  return __pyx_r;
14374 }
14375 
14376 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14377  PyObject *__pyx_r = NULL;
14378  __Pyx_TraceDeclarations
14379  __Pyx_RefNannyDeclarations
14380  PyObject *__pyx_t_1 = NULL;
14381  __Pyx_RefNannySetupContext("__get__", 0);
14382  __Pyx_TraceCall("__get__", __pyx_f[1], 578, 0, __PYX_ERR(1, 578, __pyx_L1_error));
14383 
14384  /* "View.MemoryView":579
14385  * @property
14386  * def ndim(self):
14387  * return self.view.ndim # <<<<<<<<<<<<<<
14388  *
14389  * @property
14390  */
14391  __Pyx_XDECREF(__pyx_r);
14392  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 579, __pyx_L1_error)
14393  __Pyx_GOTREF(__pyx_t_1);
14394  __pyx_r = __pyx_t_1;
14395  __pyx_t_1 = 0;
14396  goto __pyx_L0;
14397 
14398  /* "View.MemoryView":578
14399  *
14400  * @property
14401  * def ndim(self): # <<<<<<<<<<<<<<
14402  * return self.view.ndim
14403  *
14404  */
14405 
14406  /* function exit code */
14407  __pyx_L1_error:;
14408  __Pyx_XDECREF(__pyx_t_1);
14409  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14410  __pyx_r = NULL;
14411  __pyx_L0:;
14412  __Pyx_XGIVEREF(__pyx_r);
14413  __Pyx_TraceReturn(__pyx_r, 0);
14414  __Pyx_RefNannyFinishContext();
14415  return __pyx_r;
14416 }
14417 
14418 /* "View.MemoryView":582
14419  *
14420  * @property
14421  * def itemsize(self): # <<<<<<<<<<<<<<
14422  * return self.view.itemsize
14423  *
14424  */
14425 
14426 /* Python wrapper */
14427 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
14428 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
14429  PyObject *__pyx_r = 0;
14430  __Pyx_RefNannyDeclarations
14431  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14432  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14433 
14434  /* function exit code */
14435  __Pyx_RefNannyFinishContext();
14436  return __pyx_r;
14437 }
14438 
14439 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14440  PyObject *__pyx_r = NULL;
14441  __Pyx_TraceDeclarations
14442  __Pyx_RefNannyDeclarations
14443  PyObject *__pyx_t_1 = NULL;
14444  __Pyx_RefNannySetupContext("__get__", 0);
14445  __Pyx_TraceCall("__get__", __pyx_f[1], 582, 0, __PYX_ERR(1, 582, __pyx_L1_error));
14446 
14447  /* "View.MemoryView":583
14448  * @property
14449  * def itemsize(self):
14450  * return self.view.itemsize # <<<<<<<<<<<<<<
14451  *
14452  * @property
14453  */
14454  __Pyx_XDECREF(__pyx_r);
14455  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error)
14456  __Pyx_GOTREF(__pyx_t_1);
14457  __pyx_r = __pyx_t_1;
14458  __pyx_t_1 = 0;
14459  goto __pyx_L0;
14460 
14461  /* "View.MemoryView":582
14462  *
14463  * @property
14464  * def itemsize(self): # <<<<<<<<<<<<<<
14465  * return self.view.itemsize
14466  *
14467  */
14468 
14469  /* function exit code */
14470  __pyx_L1_error:;
14471  __Pyx_XDECREF(__pyx_t_1);
14472  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14473  __pyx_r = NULL;
14474  __pyx_L0:;
14475  __Pyx_XGIVEREF(__pyx_r);
14476  __Pyx_TraceReturn(__pyx_r, 0);
14477  __Pyx_RefNannyFinishContext();
14478  return __pyx_r;
14479 }
14480 
14481 /* "View.MemoryView":586
14482  *
14483  * @property
14484  * def nbytes(self): # <<<<<<<<<<<<<<
14485  * return self.size * self.view.itemsize
14486  *
14487  */
14488 
14489 /* Python wrapper */
14490 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
14491 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
14492  PyObject *__pyx_r = 0;
14493  __Pyx_RefNannyDeclarations
14494  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14495  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14496 
14497  /* function exit code */
14498  __Pyx_RefNannyFinishContext();
14499  return __pyx_r;
14500 }
14501 
14502 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14503  PyObject *__pyx_r = NULL;
14504  __Pyx_TraceDeclarations
14505  __Pyx_RefNannyDeclarations
14506  PyObject *__pyx_t_1 = NULL;
14507  PyObject *__pyx_t_2 = NULL;
14508  PyObject *__pyx_t_3 = NULL;
14509  __Pyx_RefNannySetupContext("__get__", 0);
14510  __Pyx_TraceCall("__get__", __pyx_f[1], 586, 0, __PYX_ERR(1, 586, __pyx_L1_error));
14511 
14512  /* "View.MemoryView":587
14513  * @property
14514  * def nbytes(self):
14515  * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
14516  *
14517  * @property
14518  */
14519  __Pyx_XDECREF(__pyx_r);
14520  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error)
14521  __Pyx_GOTREF(__pyx_t_1);
14522  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 587, __pyx_L1_error)
14523  __Pyx_GOTREF(__pyx_t_2);
14524  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 587, __pyx_L1_error)
14525  __Pyx_GOTREF(__pyx_t_3);
14526  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14527  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14528  __pyx_r = __pyx_t_3;
14529  __pyx_t_3 = 0;
14530  goto __pyx_L0;
14531 
14532  /* "View.MemoryView":586
14533  *
14534  * @property
14535  * def nbytes(self): # <<<<<<<<<<<<<<
14536  * return self.size * self.view.itemsize
14537  *
14538  */
14539 
14540  /* function exit code */
14541  __pyx_L1_error:;
14542  __Pyx_XDECREF(__pyx_t_1);
14543  __Pyx_XDECREF(__pyx_t_2);
14544  __Pyx_XDECREF(__pyx_t_3);
14545  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14546  __pyx_r = NULL;
14547  __pyx_L0:;
14548  __Pyx_XGIVEREF(__pyx_r);
14549  __Pyx_TraceReturn(__pyx_r, 0);
14550  __Pyx_RefNannyFinishContext();
14551  return __pyx_r;
14552 }
14553 
14554 /* "View.MemoryView":590
14555  *
14556  * @property
14557  * def size(self): # <<<<<<<<<<<<<<
14558  * if self._size is None:
14559  * result = 1
14560  */
14561 
14562 /* Python wrapper */
14563 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
14564 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
14565  PyObject *__pyx_r = 0;
14566  __Pyx_RefNannyDeclarations
14567  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14568  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14569 
14570  /* function exit code */
14571  __Pyx_RefNannyFinishContext();
14572  return __pyx_r;
14573 }
14574 
14575 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14576  PyObject *__pyx_v_result = NULL;
14577  PyObject *__pyx_v_length = NULL;
14578  PyObject *__pyx_r = NULL;
14579  __Pyx_TraceDeclarations
14580  __Pyx_RefNannyDeclarations
14581  int __pyx_t_1;
14582  int __pyx_t_2;
14583  Py_ssize_t *__pyx_t_3;
14584  Py_ssize_t *__pyx_t_4;
14585  Py_ssize_t *__pyx_t_5;
14586  PyObject *__pyx_t_6 = NULL;
14587  __Pyx_RefNannySetupContext("__get__", 0);
14588  __Pyx_TraceCall("__get__", __pyx_f[1], 590, 0, __PYX_ERR(1, 590, __pyx_L1_error));
14589 
14590  /* "View.MemoryView":591
14591  * @property
14592  * def size(self):
14593  * if self._size is None: # <<<<<<<<<<<<<<
14594  * result = 1
14595  *
14596  */
14597  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
14598  __pyx_t_2 = (__pyx_t_1 != 0);
14599  if (__pyx_t_2) {
14600 
14601  /* "View.MemoryView":592
14602  * def size(self):
14603  * if self._size is None:
14604  * result = 1 # <<<<<<<<<<<<<<
14605  *
14606  * for length in self.view.shape[:self.view.ndim]:
14607  */
14608  __Pyx_INCREF(__pyx_int_1);
14609  __pyx_v_result = __pyx_int_1;
14610 
14611  /* "View.MemoryView":594
14612  * result = 1
14613  *
14614  * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
14615  * result *= length
14616  *
14617  */
14618  __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
14619  for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
14620  __pyx_t_3 = __pyx_t_5;
14621  __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 594, __pyx_L1_error)
14622  __Pyx_GOTREF(__pyx_t_6);
14623  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
14624  __pyx_t_6 = 0;
14625 
14626  /* "View.MemoryView":595
14627  *
14628  * for length in self.view.shape[:self.view.ndim]:
14629  * result *= length # <<<<<<<<<<<<<<
14630  *
14631  * self._size = result
14632  */
14633  __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 595, __pyx_L1_error)
14634  __Pyx_GOTREF(__pyx_t_6);
14635  __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
14636  __pyx_t_6 = 0;
14637  }
14638 
14639  /* "View.MemoryView":597
14640  * result *= length
14641  *
14642  * self._size = result # <<<<<<<<<<<<<<
14643  *
14644  * return self._size
14645  */
14646  __Pyx_INCREF(__pyx_v_result);
14647  __Pyx_GIVEREF(__pyx_v_result);
14648  __Pyx_GOTREF(__pyx_v_self->_size);
14649  __Pyx_DECREF(__pyx_v_self->_size);
14650  __pyx_v_self->_size = __pyx_v_result;
14651 
14652  /* "View.MemoryView":591
14653  * @property
14654  * def size(self):
14655  * if self._size is None: # <<<<<<<<<<<<<<
14656  * result = 1
14657  *
14658  */
14659  }
14660 
14661  /* "View.MemoryView":599
14662  * self._size = result
14663  *
14664  * return self._size # <<<<<<<<<<<<<<
14665  *
14666  * def __len__(self):
14667  */
14668  __Pyx_XDECREF(__pyx_r);
14669  __Pyx_INCREF(__pyx_v_self->_size);
14670  __pyx_r = __pyx_v_self->_size;
14671  goto __pyx_L0;
14672 
14673  /* "View.MemoryView":590
14674  *
14675  * @property
14676  * def size(self): # <<<<<<<<<<<<<<
14677  * if self._size is None:
14678  * result = 1
14679  */
14680 
14681  /* function exit code */
14682  __pyx_L1_error:;
14683  __Pyx_XDECREF(__pyx_t_6);
14684  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14685  __pyx_r = NULL;
14686  __pyx_L0:;
14687  __Pyx_XDECREF(__pyx_v_result);
14688  __Pyx_XDECREF(__pyx_v_length);
14689  __Pyx_XGIVEREF(__pyx_r);
14690  __Pyx_TraceReturn(__pyx_r, 0);
14691  __Pyx_RefNannyFinishContext();
14692  return __pyx_r;
14693 }
14694 
14695 /* "View.MemoryView":601
14696  * return self._size
14697  *
14698  * def __len__(self): # <<<<<<<<<<<<<<
14699  * if self.view.ndim >= 1:
14700  * return self.view.shape[0]
14701  */
14702 
14703 /* Python wrapper */
14704 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
14705 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
14706  Py_ssize_t __pyx_r;
14707  __Pyx_RefNannyDeclarations
14708  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
14709  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14710 
14711  /* function exit code */
14712  __Pyx_RefNannyFinishContext();
14713  return __pyx_r;
14714 }
14715 
14716 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
14717  Py_ssize_t __pyx_r;
14718  __Pyx_TraceDeclarations
14719  __Pyx_RefNannyDeclarations
14720  int __pyx_t_1;
14721  __Pyx_RefNannySetupContext("__len__", 0);
14722  __Pyx_TraceCall("__len__", __pyx_f[1], 601, 0, __PYX_ERR(1, 601, __pyx_L1_error));
14723 
14724  /* "View.MemoryView":602
14725  *
14726  * def __len__(self):
14727  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
14728  * return self.view.shape[0]
14729  *
14730  */
14731  __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
14732  if (__pyx_t_1) {
14733 
14734  /* "View.MemoryView":603
14735  * def __len__(self):
14736  * if self.view.ndim >= 1:
14737  * return self.view.shape[0] # <<<<<<<<<<<<<<
14738  *
14739  * return 0
14740  */
14741  __pyx_r = (__pyx_v_self->view.shape[0]);
14742  goto __pyx_L0;
14743 
14744  /* "View.MemoryView":602
14745  *
14746  * def __len__(self):
14747  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
14748  * return self.view.shape[0]
14749  *
14750  */
14751  }
14752 
14753  /* "View.MemoryView":605
14754  * return self.view.shape[0]
14755  *
14756  * return 0 # <<<<<<<<<<<<<<
14757  *
14758  * def __repr__(self):
14759  */
14760  __pyx_r = 0;
14761  goto __pyx_L0;
14762 
14763  /* "View.MemoryView":601
14764  * return self._size
14765  *
14766  * def __len__(self): # <<<<<<<<<<<<<<
14767  * if self.view.ndim >= 1:
14768  * return self.view.shape[0]
14769  */
14770 
14771  /* function exit code */
14772  __pyx_L1_error:;
14773  __Pyx_AddTraceback("View.MemoryView.memoryview.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14774  __pyx_r = -1;
14775  __pyx_L0:;
14776  __Pyx_TraceReturn(Py_None, 0);
14777  __Pyx_RefNannyFinishContext();
14778  return __pyx_r;
14779 }
14780 
14781 /* "View.MemoryView":607
14782  * return 0
14783  *
14784  * def __repr__(self): # <<<<<<<<<<<<<<
14785  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14786  * id(self))
14787  */
14788 
14789 /* Python wrapper */
14790 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
14791 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
14792  PyObject *__pyx_r = 0;
14793  __Pyx_RefNannyDeclarations
14794  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
14795  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14796 
14797  /* function exit code */
14798  __Pyx_RefNannyFinishContext();
14799  return __pyx_r;
14800 }
14801 
14802 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
14803  PyObject *__pyx_r = NULL;
14804  __Pyx_TraceDeclarations
14805  __Pyx_RefNannyDeclarations
14806  PyObject *__pyx_t_1 = NULL;
14807  PyObject *__pyx_t_2 = NULL;
14808  PyObject *__pyx_t_3 = NULL;
14809  __Pyx_RefNannySetupContext("__repr__", 0);
14810  __Pyx_TraceCall("__repr__", __pyx_f[1], 607, 0, __PYX_ERR(1, 607, __pyx_L1_error));
14811 
14812  /* "View.MemoryView":608
14813  *
14814  * def __repr__(self):
14815  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
14816  * id(self))
14817  *
14818  */
14819  __Pyx_XDECREF(__pyx_r);
14820  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 608, __pyx_L1_error)
14821  __Pyx_GOTREF(__pyx_t_1);
14822  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 608, __pyx_L1_error)
14823  __Pyx_GOTREF(__pyx_t_2);
14824  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14825  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 608, __pyx_L1_error)
14826  __Pyx_GOTREF(__pyx_t_1);
14827  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14828 
14829  /* "View.MemoryView":609
14830  * def __repr__(self):
14831  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14832  * id(self)) # <<<<<<<<<<<<<<
14833  *
14834  * def __str__(self):
14835  */
14836  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 609, __pyx_L1_error)
14837  __Pyx_GOTREF(__pyx_t_2);
14838 
14839  /* "View.MemoryView":608
14840  *
14841  * def __repr__(self):
14842  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
14843  * id(self))
14844  *
14845  */
14846  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 608, __pyx_L1_error)
14847  __Pyx_GOTREF(__pyx_t_3);
14848  __Pyx_GIVEREF(__pyx_t_1);
14849  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
14850  __Pyx_GIVEREF(__pyx_t_2);
14851  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
14852  __pyx_t_1 = 0;
14853  __pyx_t_2 = 0;
14854  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 608, __pyx_L1_error)
14855  __Pyx_GOTREF(__pyx_t_2);
14856  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14857  __pyx_r = __pyx_t_2;
14858  __pyx_t_2 = 0;
14859  goto __pyx_L0;
14860 
14861  /* "View.MemoryView":607
14862  * return 0
14863  *
14864  * def __repr__(self): # <<<<<<<<<<<<<<
14865  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14866  * id(self))
14867  */
14868 
14869  /* function exit code */
14870  __pyx_L1_error:;
14871  __Pyx_XDECREF(__pyx_t_1);
14872  __Pyx_XDECREF(__pyx_t_2);
14873  __Pyx_XDECREF(__pyx_t_3);
14874  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14875  __pyx_r = NULL;
14876  __pyx_L0:;
14877  __Pyx_XGIVEREF(__pyx_r);
14878  __Pyx_TraceReturn(__pyx_r, 0);
14879  __Pyx_RefNannyFinishContext();
14880  return __pyx_r;
14881 }
14882 
14883 /* "View.MemoryView":611
14884  * id(self))
14885  *
14886  * def __str__(self): # <<<<<<<<<<<<<<
14887  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
14888  *
14889  */
14890 
14891 /* Python wrapper */
14892 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
14893 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
14894  PyObject *__pyx_r = 0;
14895  __Pyx_RefNannyDeclarations
14896  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
14897  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14898 
14899  /* function exit code */
14900  __Pyx_RefNannyFinishContext();
14901  return __pyx_r;
14902 }
14903 
14904 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
14905  PyObject *__pyx_r = NULL;
14906  __Pyx_TraceDeclarations
14907  __Pyx_RefNannyDeclarations
14908  PyObject *__pyx_t_1 = NULL;
14909  PyObject *__pyx_t_2 = NULL;
14910  __Pyx_RefNannySetupContext("__str__", 0);
14911  __Pyx_TraceCall("__str__", __pyx_f[1], 611, 0, __PYX_ERR(1, 611, __pyx_L1_error));
14912 
14913  /* "View.MemoryView":612
14914  *
14915  * def __str__(self):
14916  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
14917  *
14918  *
14919  */
14920  __Pyx_XDECREF(__pyx_r);
14921  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
14922  __Pyx_GOTREF(__pyx_t_1);
14923  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
14924  __Pyx_GOTREF(__pyx_t_2);
14925  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14926  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
14927  __Pyx_GOTREF(__pyx_t_1);
14928  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14929  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
14930  __Pyx_GOTREF(__pyx_t_2);
14931  __Pyx_GIVEREF(__pyx_t_1);
14932  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
14933  __pyx_t_1 = 0;
14934  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
14935  __Pyx_GOTREF(__pyx_t_1);
14936  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14937  __pyx_r = __pyx_t_1;
14938  __pyx_t_1 = 0;
14939  goto __pyx_L0;
14940 
14941  /* "View.MemoryView":611
14942  * id(self))
14943  *
14944  * def __str__(self): # <<<<<<<<<<<<<<
14945  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
14946  *
14947  */
14948 
14949  /* function exit code */
14950  __pyx_L1_error:;
14951  __Pyx_XDECREF(__pyx_t_1);
14952  __Pyx_XDECREF(__pyx_t_2);
14953  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14954  __pyx_r = NULL;
14955  __pyx_L0:;
14956  __Pyx_XGIVEREF(__pyx_r);
14957  __Pyx_TraceReturn(__pyx_r, 0);
14958  __Pyx_RefNannyFinishContext();
14959  return __pyx_r;
14960 }
14961 
14962 /* "View.MemoryView":615
14963  *
14964  *
14965  * def is_c_contig(self): # <<<<<<<<<<<<<<
14966  * cdef __Pyx_memviewslice *mslice
14967  * cdef __Pyx_memviewslice tmp
14968  */
14969 
14970 /* Python wrapper */
14971 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14972 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_17is_c_contig = {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0};
14973 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14974  PyObject *__pyx_r = 0;
14975  __Pyx_RefNannyDeclarations
14976  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
14977  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
14978 
14979  /* function exit code */
14980  __Pyx_RefNannyFinishContext();
14981  return __pyx_r;
14982 }
14983 
14984 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
14985  __Pyx_memviewslice *__pyx_v_mslice;
14986  __Pyx_memviewslice __pyx_v_tmp;
14987  PyObject *__pyx_r = NULL;
14988  __Pyx_TraceDeclarations
14989  __Pyx_RefNannyDeclarations
14990  PyObject *__pyx_t_1 = NULL;
14991  __Pyx_RefNannySetupContext("is_c_contig", 0);
14992  __Pyx_TraceCall("is_c_contig", __pyx_f[1], 615, 0, __PYX_ERR(1, 615, __pyx_L1_error));
14993 
14994  /* "View.MemoryView":618
14995  * cdef __Pyx_memviewslice *mslice
14996  * cdef __Pyx_memviewslice tmp
14997  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
14998  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14999  *
15000  */
15001  __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
15002 
15003  /* "View.MemoryView":619
15004  * cdef __Pyx_memviewslice tmp
15005  * mslice = get_slice_from_memview(self, &tmp)
15006  * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
15007  *
15008  * def is_f_contig(self):
15009  */
15010  __Pyx_XDECREF(__pyx_r);
15011  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 619, __pyx_L1_error)
15012  __Pyx_GOTREF(__pyx_t_1);
15013  __pyx_r = __pyx_t_1;
15014  __pyx_t_1 = 0;
15015  goto __pyx_L0;
15016 
15017  /* "View.MemoryView":615
15018  *
15019  *
15020  * def is_c_contig(self): # <<<<<<<<<<<<<<
15021  * cdef __Pyx_memviewslice *mslice
15022  * cdef __Pyx_memviewslice tmp
15023  */
15024 
15025  /* function exit code */
15026  __pyx_L1_error:;
15027  __Pyx_XDECREF(__pyx_t_1);
15028  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
15029  __pyx_r = NULL;
15030  __pyx_L0:;
15031  __Pyx_XGIVEREF(__pyx_r);
15032  __Pyx_TraceReturn(__pyx_r, 0);
15033  __Pyx_RefNannyFinishContext();
15034  return __pyx_r;
15035 }
15036 
15037 /* "View.MemoryView":621
15038  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
15039  *
15040  * def is_f_contig(self): # <<<<<<<<<<<<<<
15041  * cdef __Pyx_memviewslice *mslice
15042  * cdef __Pyx_memviewslice tmp
15043  */
15044 
15045 /* Python wrapper */
15046 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
15047 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_19is_f_contig = {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0};
15048 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15049  PyObject *__pyx_r = 0;
15050  __Pyx_RefNannyDeclarations
15051  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
15052  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
15053 
15054  /* function exit code */
15055  __Pyx_RefNannyFinishContext();
15056  return __pyx_r;
15057 }
15058 
15059 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
15060  __Pyx_memviewslice *__pyx_v_mslice;
15061  __Pyx_memviewslice __pyx_v_tmp;
15062  PyObject *__pyx_r = NULL;
15063  __Pyx_TraceDeclarations
15064  __Pyx_RefNannyDeclarations
15065  PyObject *__pyx_t_1 = NULL;
15066  __Pyx_RefNannySetupContext("is_f_contig", 0);
15067  __Pyx_TraceCall("is_f_contig", __pyx_f[1], 621, 0, __PYX_ERR(1, 621, __pyx_L1_error));
15068 
15069  /* "View.MemoryView":624
15070  * cdef __Pyx_memviewslice *mslice
15071  * cdef __Pyx_memviewslice tmp
15072  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
15073  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
15074  *
15075  */
15076  __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
15077 
15078  /* "View.MemoryView":625
15079  * cdef __Pyx_memviewslice tmp
15080  * mslice = get_slice_from_memview(self, &tmp)
15081  * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
15082  *
15083  * def copy(self):
15084  */
15085  __Pyx_XDECREF(__pyx_r);
15086  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 625, __pyx_L1_error)
15087  __Pyx_GOTREF(__pyx_t_1);
15088  __pyx_r = __pyx_t_1;
15089  __pyx_t_1 = 0;
15090  goto __pyx_L0;
15091 
15092  /* "View.MemoryView":621
15093  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
15094  *
15095  * def is_f_contig(self): # <<<<<<<<<<<<<<
15096  * cdef __Pyx_memviewslice *mslice
15097  * cdef __Pyx_memviewslice tmp
15098  */
15099 
15100  /* function exit code */
15101  __pyx_L1_error:;
15102  __Pyx_XDECREF(__pyx_t_1);
15103  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
15104  __pyx_r = NULL;
15105  __pyx_L0:;
15106  __Pyx_XGIVEREF(__pyx_r);
15107  __Pyx_TraceReturn(__pyx_r, 0);
15108  __Pyx_RefNannyFinishContext();
15109  return __pyx_r;
15110 }
15111 
15112 /* "View.MemoryView":627
15113  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
15114  *
15115  * def copy(self): # <<<<<<<<<<<<<<
15116  * cdef __Pyx_memviewslice mslice
15117  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
15118  */
15119 
15120 /* Python wrapper */
15121 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
15122 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_21copy = {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0};
15123 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15124  PyObject *__pyx_r = 0;
15125  __Pyx_RefNannyDeclarations
15126  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
15127  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
15128 
15129  /* function exit code */
15130  __Pyx_RefNannyFinishContext();
15131  return __pyx_r;
15132 }
15133 
15134 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
15135  __Pyx_memviewslice __pyx_v_mslice;
15136  int __pyx_v_flags;
15137  PyObject *__pyx_r = NULL;
15138  __Pyx_TraceDeclarations
15139  __Pyx_RefNannyDeclarations
15140  __Pyx_memviewslice __pyx_t_1;
15141  PyObject *__pyx_t_2 = NULL;
15142  __Pyx_RefNannySetupContext("copy", 0);
15143  __Pyx_TraceCall("copy", __pyx_f[1], 627, 0, __PYX_ERR(1, 627, __pyx_L1_error));
15144 
15145  /* "View.MemoryView":629
15146  * def copy(self):
15147  * cdef __Pyx_memviewslice mslice
15148  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
15149  *
15150  * slice_copy(self, &mslice)
15151  */
15152  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
15153 
15154  /* "View.MemoryView":631
15155  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
15156  *
15157  * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
15158  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
15159  * self.view.itemsize,
15160  */
15161  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
15162 
15163  /* "View.MemoryView":632
15164  *
15165  * slice_copy(self, &mslice)
15166  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
15167  * self.view.itemsize,
15168  * flags|PyBUF_C_CONTIGUOUS,
15169  */
15170  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 632, __pyx_L1_error)
15171  __pyx_v_mslice = __pyx_t_1;
15172 
15173  /* "View.MemoryView":637
15174  * self.dtype_is_object)
15175  *
15176  * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
15177  *
15178  * def copy_fortran(self):
15179  */
15180  __Pyx_XDECREF(__pyx_r);
15181  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 637, __pyx_L1_error)
15182  __Pyx_GOTREF(__pyx_t_2);
15183  __pyx_r = __pyx_t_2;
15184  __pyx_t_2 = 0;
15185  goto __pyx_L0;
15186 
15187  /* "View.MemoryView":627
15188  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
15189  *
15190  * def copy(self): # <<<<<<<<<<<<<<
15191  * cdef __Pyx_memviewslice mslice
15192  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
15193  */
15194 
15195  /* function exit code */
15196  __pyx_L1_error:;
15197  __Pyx_XDECREF(__pyx_t_2);
15198  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
15199  __pyx_r = NULL;
15200  __pyx_L0:;
15201  __Pyx_XGIVEREF(__pyx_r);
15202  __Pyx_TraceReturn(__pyx_r, 0);
15203  __Pyx_RefNannyFinishContext();
15204  return __pyx_r;
15205 }
15206 
15207 /* "View.MemoryView":639
15208  * return memoryview_copy_from_slice(self, &mslice)
15209  *
15210  * def copy_fortran(self): # <<<<<<<<<<<<<<
15211  * cdef __Pyx_memviewslice src, dst
15212  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
15213  */
15214 
15215 /* Python wrapper */
15216 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
15217 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_23copy_fortran = {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0};
15218 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15219  PyObject *__pyx_r = 0;
15220  __Pyx_RefNannyDeclarations
15221  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
15222  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
15223 
15224  /* function exit code */
15225  __Pyx_RefNannyFinishContext();
15226  return __pyx_r;
15227 }
15228 
15229 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
15230  __Pyx_memviewslice __pyx_v_src;
15231  __Pyx_memviewslice __pyx_v_dst;
15232  int __pyx_v_flags;
15233  PyObject *__pyx_r = NULL;
15234  __Pyx_TraceDeclarations
15235  __Pyx_RefNannyDeclarations
15236  __Pyx_memviewslice __pyx_t_1;
15237  PyObject *__pyx_t_2 = NULL;
15238  __Pyx_RefNannySetupContext("copy_fortran", 0);
15239  __Pyx_TraceCall("copy_fortran", __pyx_f[1], 639, 0, __PYX_ERR(1, 639, __pyx_L1_error));
15240 
15241  /* "View.MemoryView":641
15242  * def copy_fortran(self):
15243  * cdef __Pyx_memviewslice src, dst
15244  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
15245  *
15246  * slice_copy(self, &src)
15247  */
15248  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
15249 
15250  /* "View.MemoryView":643
15251  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
15252  *
15253  * slice_copy(self, &src) # <<<<<<<<<<<<<<
15254  * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
15255  * self.view.itemsize,
15256  */
15257  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
15258 
15259  /* "View.MemoryView":644
15260  *
15261  * slice_copy(self, &src)
15262  * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
15263  * self.view.itemsize,
15264  * flags|PyBUF_F_CONTIGUOUS,
15265  */
15266  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 644, __pyx_L1_error)
15267  __pyx_v_dst = __pyx_t_1;
15268 
15269  /* "View.MemoryView":649
15270  * self.dtype_is_object)
15271  *
15272  * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
15273  *
15274  *
15275  */
15276  __Pyx_XDECREF(__pyx_r);
15277  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 649, __pyx_L1_error)
15278  __Pyx_GOTREF(__pyx_t_2);
15279  __pyx_r = __pyx_t_2;
15280  __pyx_t_2 = 0;
15281  goto __pyx_L0;
15282 
15283  /* "View.MemoryView":639
15284  * return memoryview_copy_from_slice(self, &mslice)
15285  *
15286  * def copy_fortran(self): # <<<<<<<<<<<<<<
15287  * cdef __Pyx_memviewslice src, dst
15288  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
15289  */
15290 
15291  /* function exit code */
15292  __pyx_L1_error:;
15293  __Pyx_XDECREF(__pyx_t_2);
15294  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
15295  __pyx_r = NULL;
15296  __pyx_L0:;
15297  __Pyx_XGIVEREF(__pyx_r);
15298  __Pyx_TraceReturn(__pyx_r, 0);
15299  __Pyx_RefNannyFinishContext();
15300  return __pyx_r;
15301 }
15302 
15303 /* "(tree fragment)":1
15304  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
15305  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15306  * def __setstate_cython__(self, __pyx_state):
15307  */
15308 
15309 /* Python wrapper */
15310 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
15311 static PyMethodDef __pyx_mdef___pyx_memoryview_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0};
15312 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15313  PyObject *__pyx_r = 0;
15314  __Pyx_RefNannyDeclarations
15315  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
15316  __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
15317 
15318  /* function exit code */
15319  __Pyx_RefNannyFinishContext();
15320  return __pyx_r;
15321 }
15322 
15323 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
15324  PyObject *__pyx_r = NULL;
15325  __Pyx_TraceDeclarations
15326  __Pyx_RefNannyDeclarations
15327  PyObject *__pyx_t_1 = NULL;
15328  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
15329  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
15330 
15331  /* "(tree fragment)":2
15332  * def __reduce_cython__(self):
15333  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15334  * def __setstate_cython__(self, __pyx_state):
15335  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15336  */
15337  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
15338  __Pyx_GOTREF(__pyx_t_1);
15339  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
15340  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15341  __PYX_ERR(1, 2, __pyx_L1_error)
15342 
15343  /* "(tree fragment)":1
15344  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
15345  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15346  * def __setstate_cython__(self, __pyx_state):
15347  */
15348 
15349  /* function exit code */
15350  __pyx_L1_error:;
15351  __Pyx_XDECREF(__pyx_t_1);
15352  __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15353  __pyx_r = NULL;
15354  __Pyx_XGIVEREF(__pyx_r);
15355  __Pyx_TraceReturn(__pyx_r, 0);
15356  __Pyx_RefNannyFinishContext();
15357  return __pyx_r;
15358 }
15359 
15360 /* "(tree fragment)":3
15361  * def __reduce_cython__(self):
15362  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15363  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
15364  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15365  */
15366 
15367 /* Python wrapper */
15368 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
15369 static PyMethodDef __pyx_mdef___pyx_memoryview_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0};
15370 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
15371  PyObject *__pyx_r = 0;
15372  __Pyx_RefNannyDeclarations
15373  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
15374  __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
15375 
15376  /* function exit code */
15377  __Pyx_RefNannyFinishContext();
15378  return __pyx_r;
15379 }
15380 
15381 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
15382  PyObject *__pyx_r = NULL;
15383  __Pyx_TraceDeclarations
15384  __Pyx_RefNannyDeclarations
15385  PyObject *__pyx_t_1 = NULL;
15386  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
15387  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
15388 
15389  /* "(tree fragment)":4
15390  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15391  * def __setstate_cython__(self, __pyx_state):
15392  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15393  */
15394  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
15395  __Pyx_GOTREF(__pyx_t_1);
15396  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
15397  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15398  __PYX_ERR(1, 4, __pyx_L1_error)
15399 
15400  /* "(tree fragment)":3
15401  * def __reduce_cython__(self):
15402  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15403  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
15404  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15405  */
15406 
15407  /* function exit code */
15408  __pyx_L1_error:;
15409  __Pyx_XDECREF(__pyx_t_1);
15410  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15411  __pyx_r = NULL;
15412  __Pyx_XGIVEREF(__pyx_r);
15413  __Pyx_TraceReturn(__pyx_r, 0);
15414  __Pyx_RefNannyFinishContext();
15415  return __pyx_r;
15416 }
15417 
15418 /* "View.MemoryView":653
15419  *
15420  * @cname('__pyx_memoryview_new')
15421  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
15422  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
15423  * result.typeinfo = typeinfo
15424  */
15425 
15426 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
15427  struct __pyx_memoryview_obj *__pyx_v_result = 0;
15428  PyObject *__pyx_r = NULL;
15429  __Pyx_TraceDeclarations
15430  __Pyx_RefNannyDeclarations
15431  PyObject *__pyx_t_1 = NULL;
15432  PyObject *__pyx_t_2 = NULL;
15433  PyObject *__pyx_t_3 = NULL;
15434  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
15435  __Pyx_TraceCall("memoryview_cwrapper", __pyx_f[1], 653, 0, __PYX_ERR(1, 653, __pyx_L1_error));
15436 
15437  /* "View.MemoryView":654
15438  * @cname('__pyx_memoryview_new')
15439  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
15440  * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
15441  * result.typeinfo = typeinfo
15442  * return result
15443  */
15444  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 654, __pyx_L1_error)
15445  __Pyx_GOTREF(__pyx_t_1);
15446  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 654, __pyx_L1_error)
15447  __Pyx_GOTREF(__pyx_t_2);
15448  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 654, __pyx_L1_error)
15449  __Pyx_GOTREF(__pyx_t_3);
15450  __Pyx_INCREF(__pyx_v_o);
15451  __Pyx_GIVEREF(__pyx_v_o);
15452  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
15453  __Pyx_GIVEREF(__pyx_t_1);
15454  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
15455  __Pyx_GIVEREF(__pyx_t_2);
15456  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
15457  __pyx_t_1 = 0;
15458  __pyx_t_2 = 0;
15459  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 654, __pyx_L1_error)
15460  __Pyx_GOTREF(__pyx_t_2);
15461  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15462  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
15463  __pyx_t_2 = 0;
15464 
15465  /* "View.MemoryView":655
15466  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
15467  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
15468  * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
15469  * return result
15470  *
15471  */
15472  __pyx_v_result->typeinfo = __pyx_v_typeinfo;
15473 
15474  /* "View.MemoryView":656
15475  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
15476  * result.typeinfo = typeinfo
15477  * return result # <<<<<<<<<<<<<<
15478  *
15479  * @cname('__pyx_memoryview_check')
15480  */
15481  __Pyx_XDECREF(__pyx_r);
15482  __Pyx_INCREF(((PyObject *)__pyx_v_result));
15483  __pyx_r = ((PyObject *)__pyx_v_result);
15484  goto __pyx_L0;
15485 
15486  /* "View.MemoryView":653
15487  *
15488  * @cname('__pyx_memoryview_new')
15489  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
15490  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
15491  * result.typeinfo = typeinfo
15492  */
15493 
15494  /* function exit code */
15495  __pyx_L1_error:;
15496  __Pyx_XDECREF(__pyx_t_1);
15497  __Pyx_XDECREF(__pyx_t_2);
15498  __Pyx_XDECREF(__pyx_t_3);
15499  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
15500  __pyx_r = 0;
15501  __pyx_L0:;
15502  __Pyx_XDECREF((PyObject *)__pyx_v_result);
15503  __Pyx_XGIVEREF(__pyx_r);
15504  __Pyx_TraceReturn(__pyx_r, 0);
15505  __Pyx_RefNannyFinishContext();
15506  return __pyx_r;
15507 }
15508 
15509 /* "View.MemoryView":659
15510  *
15511  * @cname('__pyx_memoryview_check')
15512  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
15513  * return isinstance(o, memoryview)
15514  *
15515  */
15516 
15517 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
15518  int __pyx_r;
15519  __Pyx_TraceDeclarations
15520  __Pyx_RefNannyDeclarations
15521  int __pyx_t_1;
15522  __Pyx_RefNannySetupContext("memoryview_check", 0);
15523  __Pyx_TraceCall("memoryview_check", __pyx_f[1], 659, 0, __PYX_ERR(1, 659, __pyx_L1_error));
15524 
15525  /* "View.MemoryView":660
15526  * @cname('__pyx_memoryview_check')
15527  * cdef inline bint memoryview_check(object o):
15528  * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
15529  *
15530  * cdef tuple _unellipsify(object index, int ndim):
15531  */
15532  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
15533  __pyx_r = __pyx_t_1;
15534  goto __pyx_L0;
15535 
15536  /* "View.MemoryView":659
15537  *
15538  * @cname('__pyx_memoryview_check')
15539  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
15540  * return isinstance(o, memoryview)
15541  *
15542  */
15543 
15544  /* function exit code */
15545  __pyx_L1_error:;
15546  __Pyx_WriteUnraisable("View.MemoryView.memoryview_check", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
15547  __pyx_r = 0;
15548  __pyx_L0:;
15549  __Pyx_TraceReturn(Py_None, 0);
15550  __Pyx_RefNannyFinishContext();
15551  return __pyx_r;
15552 }
15553 
15554 /* "View.MemoryView":662
15555  * return isinstance(o, memoryview)
15556  *
15557  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
15558  * """
15559  * Replace all ellipses with full slices and fill incomplete indices with
15560  */
15561 
15562 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
15563  PyObject *__pyx_v_tup = NULL;
15564  PyObject *__pyx_v_result = NULL;
15565  int __pyx_v_have_slices;
15566  int __pyx_v_seen_ellipsis;
15567  CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
15568  PyObject *__pyx_v_item = NULL;
15569  Py_ssize_t __pyx_v_nslices;
15570  PyObject *__pyx_r = NULL;
15571  __Pyx_TraceDeclarations
15572  __Pyx_RefNannyDeclarations
15573  int __pyx_t_1;
15574  int __pyx_t_2;
15575  PyObject *__pyx_t_3 = NULL;
15576  PyObject *__pyx_t_4 = NULL;
15577  Py_ssize_t __pyx_t_5;
15578  PyObject *(*__pyx_t_6)(PyObject *);
15579  PyObject *__pyx_t_7 = NULL;
15580  Py_ssize_t __pyx_t_8;
15581  int __pyx_t_9;
15582  int __pyx_t_10;
15583  PyObject *__pyx_t_11 = NULL;
15584  __Pyx_RefNannySetupContext("_unellipsify", 0);
15585  __Pyx_TraceCall("_unellipsify", __pyx_f[1], 662, 0, __PYX_ERR(1, 662, __pyx_L1_error));
15586 
15587  /* "View.MemoryView":667
15588  * full slices.
15589  * """
15590  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
15591  * tup = (index,)
15592  * else:
15593  */
15594  __pyx_t_1 = PyTuple_Check(__pyx_v_index);
15595  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15596  if (__pyx_t_2) {
15597 
15598  /* "View.MemoryView":668
15599  * """
15600  * if not isinstance(index, tuple):
15601  * tup = (index,) # <<<<<<<<<<<<<<
15602  * else:
15603  * tup = index
15604  */
15605  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 668, __pyx_L1_error)
15606  __Pyx_GOTREF(__pyx_t_3);
15607  __Pyx_INCREF(__pyx_v_index);
15608  __Pyx_GIVEREF(__pyx_v_index);
15609  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
15610  __pyx_v_tup = __pyx_t_3;
15611  __pyx_t_3 = 0;
15612 
15613  /* "View.MemoryView":667
15614  * full slices.
15615  * """
15616  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
15617  * tup = (index,)
15618  * else:
15619  */
15620  goto __pyx_L3;
15621  }
15622 
15623  /* "View.MemoryView":670
15624  * tup = (index,)
15625  * else:
15626  * tup = index # <<<<<<<<<<<<<<
15627  *
15628  * result = []
15629  */
15630  /*else*/ {
15631  __Pyx_INCREF(__pyx_v_index);
15632  __pyx_v_tup = __pyx_v_index;
15633  }
15634  __pyx_L3:;
15635 
15636  /* "View.MemoryView":672
15637  * tup = index
15638  *
15639  * result = [] # <<<<<<<<<<<<<<
15640  * have_slices = False
15641  * seen_ellipsis = False
15642  */
15643  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error)
15644  __Pyx_GOTREF(__pyx_t_3);
15645  __pyx_v_result = ((PyObject*)__pyx_t_3);
15646  __pyx_t_3 = 0;
15647 
15648  /* "View.MemoryView":673
15649  *
15650  * result = []
15651  * have_slices = False # <<<<<<<<<<<<<<
15652  * seen_ellipsis = False
15653  * for idx, item in enumerate(tup):
15654  */
15655  __pyx_v_have_slices = 0;
15656 
15657  /* "View.MemoryView":674
15658  * result = []
15659  * have_slices = False
15660  * seen_ellipsis = False # <<<<<<<<<<<<<<
15661  * for idx, item in enumerate(tup):
15662  * if item is Ellipsis:
15663  */
15664  __pyx_v_seen_ellipsis = 0;
15665 
15666  /* "View.MemoryView":675
15667  * have_slices = False
15668  * seen_ellipsis = False
15669  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
15670  * if item is Ellipsis:
15671  * if not seen_ellipsis:
15672  */
15673  __Pyx_INCREF(__pyx_int_0);
15674  __pyx_t_3 = __pyx_int_0;
15675  if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
15676  __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
15677  __pyx_t_6 = NULL;
15678  } else {
15679  __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 675, __pyx_L1_error)
15680  __Pyx_GOTREF(__pyx_t_4);
15681  __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 675, __pyx_L1_error)
15682  }
15683  for (;;) {
15684  if (likely(!__pyx_t_6)) {
15685  if (likely(PyList_CheckExact(__pyx_t_4))) {
15686  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
15687  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15688  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 675, __pyx_L1_error)
15689  #else
15690  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error)
15691  __Pyx_GOTREF(__pyx_t_7);
15692  #endif
15693  } else {
15694  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
15695  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15696  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 675, __pyx_L1_error)
15697  #else
15698  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error)
15699  __Pyx_GOTREF(__pyx_t_7);
15700  #endif
15701  }
15702  } else {
15703  __pyx_t_7 = __pyx_t_6(__pyx_t_4);
15704  if (unlikely(!__pyx_t_7)) {
15705  PyObject* exc_type = PyErr_Occurred();
15706  if (exc_type) {
15707  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15708  else __PYX_ERR(1, 675, __pyx_L1_error)
15709  }
15710  break;
15711  }
15712  __Pyx_GOTREF(__pyx_t_7);
15713  }
15714  __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
15715  __pyx_t_7 = 0;
15716  __Pyx_INCREF(__pyx_t_3);
15717  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
15718  __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error)
15719  __Pyx_GOTREF(__pyx_t_7);
15720  __Pyx_DECREF(__pyx_t_3);
15721  __pyx_t_3 = __pyx_t_7;
15722  __pyx_t_7 = 0;
15723 
15724  /* "View.MemoryView":676
15725  * seen_ellipsis = False
15726  * for idx, item in enumerate(tup):
15727  * if item is Ellipsis: # <<<<<<<<<<<<<<
15728  * if not seen_ellipsis:
15729  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15730  */
15731  __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
15732  __pyx_t_1 = (__pyx_t_2 != 0);
15733  if (__pyx_t_1) {
15734 
15735  /* "View.MemoryView":677
15736  * for idx, item in enumerate(tup):
15737  * if item is Ellipsis:
15738  * if not seen_ellipsis: # <<<<<<<<<<<<<<
15739  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15740  * seen_ellipsis = True
15741  */
15742  __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
15743  if (__pyx_t_1) {
15744 
15745  /* "View.MemoryView":678
15746  * if item is Ellipsis:
15747  * if not seen_ellipsis:
15748  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
15749  * seen_ellipsis = True
15750  * else:
15751  */
15752  __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 678, __pyx_L1_error)
15753  __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 678, __pyx_L1_error)
15754  __Pyx_GOTREF(__pyx_t_7);
15755  { Py_ssize_t __pyx_temp;
15756  for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
15757  __Pyx_INCREF(__pyx_slice__7);
15758  __Pyx_GIVEREF(__pyx_slice__7);
15759  PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__7);
15760  }
15761  }
15762  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 678, __pyx_L1_error)
15763  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15764 
15765  /* "View.MemoryView":679
15766  * if not seen_ellipsis:
15767  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15768  * seen_ellipsis = True # <<<<<<<<<<<<<<
15769  * else:
15770  * result.append(slice(None))
15771  */
15772  __pyx_v_seen_ellipsis = 1;
15773 
15774  /* "View.MemoryView":677
15775  * for idx, item in enumerate(tup):
15776  * if item is Ellipsis:
15777  * if not seen_ellipsis: # <<<<<<<<<<<<<<
15778  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15779  * seen_ellipsis = True
15780  */
15781  goto __pyx_L7;
15782  }
15783 
15784  /* "View.MemoryView":681
15785  * seen_ellipsis = True
15786  * else:
15787  * result.append(slice(None)) # <<<<<<<<<<<<<<
15788  * have_slices = True
15789  * else:
15790  */
15791  /*else*/ {
15792  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 681, __pyx_L1_error)
15793  }
15794  __pyx_L7:;
15795 
15796  /* "View.MemoryView":682
15797  * else:
15798  * result.append(slice(None))
15799  * have_slices = True # <<<<<<<<<<<<<<
15800  * else:
15801  * if not isinstance(item, slice) and not PyIndex_Check(item):
15802  */
15803  __pyx_v_have_slices = 1;
15804 
15805  /* "View.MemoryView":676
15806  * seen_ellipsis = False
15807  * for idx, item in enumerate(tup):
15808  * if item is Ellipsis: # <<<<<<<<<<<<<<
15809  * if not seen_ellipsis:
15810  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15811  */
15812  goto __pyx_L6;
15813  }
15814 
15815  /* "View.MemoryView":684
15816  * have_slices = True
15817  * else:
15818  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
15819  * raise TypeError("Cannot index with type '%s'" % type(item))
15820  *
15821  */
15822  /*else*/ {
15823  __pyx_t_2 = PySlice_Check(__pyx_v_item);
15824  __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
15825  if (__pyx_t_10) {
15826  } else {
15827  __pyx_t_1 = __pyx_t_10;
15828  goto __pyx_L9_bool_binop_done;
15829  }
15830  __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
15831  __pyx_t_1 = __pyx_t_10;
15832  __pyx_L9_bool_binop_done:;
15833  if (unlikely(__pyx_t_1)) {
15834 
15835  /* "View.MemoryView":685
15836  * else:
15837  * if not isinstance(item, slice) and not PyIndex_Check(item):
15838  * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
15839  *
15840  * have_slices = have_slices or isinstance(item, slice)
15841  */
15842  __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 685, __pyx_L1_error)
15843  __Pyx_GOTREF(__pyx_t_7);
15844  __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 685, __pyx_L1_error)
15845  __Pyx_GOTREF(__pyx_t_11);
15846  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15847  __Pyx_Raise(__pyx_t_11, 0, 0, 0);
15848  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
15849  __PYX_ERR(1, 685, __pyx_L1_error)
15850 
15851  /* "View.MemoryView":684
15852  * have_slices = True
15853  * else:
15854  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
15855  * raise TypeError("Cannot index with type '%s'" % type(item))
15856  *
15857  */
15858  }
15859 
15860  /* "View.MemoryView":687
15861  * raise TypeError("Cannot index with type '%s'" % type(item))
15862  *
15863  * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
15864  * result.append(item)
15865  *
15866  */
15867  __pyx_t_10 = (__pyx_v_have_slices != 0);
15868  if (!__pyx_t_10) {
15869  } else {
15870  __pyx_t_1 = __pyx_t_10;
15871  goto __pyx_L11_bool_binop_done;
15872  }
15873  __pyx_t_10 = PySlice_Check(__pyx_v_item);
15874  __pyx_t_2 = (__pyx_t_10 != 0);
15875  __pyx_t_1 = __pyx_t_2;
15876  __pyx_L11_bool_binop_done:;
15877  __pyx_v_have_slices = __pyx_t_1;
15878 
15879  /* "View.MemoryView":688
15880  *
15881  * have_slices = have_slices or isinstance(item, slice)
15882  * result.append(item) # <<<<<<<<<<<<<<
15883  *
15884  * nslices = ndim - len(result)
15885  */
15886  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 688, __pyx_L1_error)
15887  }
15888  __pyx_L6:;
15889 
15890  /* "View.MemoryView":675
15891  * have_slices = False
15892  * seen_ellipsis = False
15893  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
15894  * if item is Ellipsis:
15895  * if not seen_ellipsis:
15896  */
15897  }
15898  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15899  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15900 
15901  /* "View.MemoryView":690
15902  * result.append(item)
15903  *
15904  * nslices = ndim - len(result) # <<<<<<<<<<<<<<
15905  * if nslices:
15906  * result.extend([slice(None)] * nslices)
15907  */
15908  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 690, __pyx_L1_error)
15909  __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
15910 
15911  /* "View.MemoryView":691
15912  *
15913  * nslices = ndim - len(result)
15914  * if nslices: # <<<<<<<<<<<<<<
15915  * result.extend([slice(None)] * nslices)
15916  *
15917  */
15918  __pyx_t_1 = (__pyx_v_nslices != 0);
15919  if (__pyx_t_1) {
15920 
15921  /* "View.MemoryView":692
15922  * nslices = ndim - len(result)
15923  * if nslices:
15924  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
15925  *
15926  * return have_slices or nslices, tuple(result)
15927  */
15928  __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 692, __pyx_L1_error)
15929  __Pyx_GOTREF(__pyx_t_3);
15930  { Py_ssize_t __pyx_temp;
15931  for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
15932  __Pyx_INCREF(__pyx_slice__7);
15933  __Pyx_GIVEREF(__pyx_slice__7);
15934  PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__7);
15935  }
15936  }
15937  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 692, __pyx_L1_error)
15938  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15939 
15940  /* "View.MemoryView":691
15941  *
15942  * nslices = ndim - len(result)
15943  * if nslices: # <<<<<<<<<<<<<<
15944  * result.extend([slice(None)] * nslices)
15945  *
15946  */
15947  }
15948 
15949  /* "View.MemoryView":694
15950  * result.extend([slice(None)] * nslices)
15951  *
15952  * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
15953  *
15954  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15955  */
15956  __Pyx_XDECREF(__pyx_r);
15957  if (!__pyx_v_have_slices) {
15958  } else {
15959  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 694, __pyx_L1_error)
15960  __Pyx_GOTREF(__pyx_t_4);
15961  __pyx_t_3 = __pyx_t_4;
15962  __pyx_t_4 = 0;
15963  goto __pyx_L14_bool_binop_done;
15964  }
15965  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 694, __pyx_L1_error)
15966  __Pyx_GOTREF(__pyx_t_4);
15967  __pyx_t_3 = __pyx_t_4;
15968  __pyx_t_4 = 0;
15969  __pyx_L14_bool_binop_done:;
15970  __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 694, __pyx_L1_error)
15971  __Pyx_GOTREF(__pyx_t_4);
15972  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 694, __pyx_L1_error)
15973  __Pyx_GOTREF(__pyx_t_11);
15974  __Pyx_GIVEREF(__pyx_t_3);
15975  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
15976  __Pyx_GIVEREF(__pyx_t_4);
15977  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
15978  __pyx_t_3 = 0;
15979  __pyx_t_4 = 0;
15980  __pyx_r = ((PyObject*)__pyx_t_11);
15981  __pyx_t_11 = 0;
15982  goto __pyx_L0;
15983 
15984  /* "View.MemoryView":662
15985  * return isinstance(o, memoryview)
15986  *
15987  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
15988  * """
15989  * Replace all ellipses with full slices and fill incomplete indices with
15990  */
15991 
15992  /* function exit code */
15993  __pyx_L1_error:;
15994  __Pyx_XDECREF(__pyx_t_3);
15995  __Pyx_XDECREF(__pyx_t_4);
15996  __Pyx_XDECREF(__pyx_t_7);
15997  __Pyx_XDECREF(__pyx_t_11);
15998  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
15999  __pyx_r = 0;
16000  __pyx_L0:;
16001  __Pyx_XDECREF(__pyx_v_tup);
16002  __Pyx_XDECREF(__pyx_v_result);
16003  __Pyx_XDECREF(__pyx_v_idx);
16004  __Pyx_XDECREF(__pyx_v_item);
16005  __Pyx_XGIVEREF(__pyx_r);
16006  __Pyx_TraceReturn(__pyx_r, 0);
16007  __Pyx_RefNannyFinishContext();
16008  return __pyx_r;
16009 }
16010 
16011 /* "View.MemoryView":696
16012  * return have_slices or nslices, tuple(result)
16013  *
16014  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
16015  * for suboffset in suboffsets[:ndim]:
16016  * if suboffset >= 0:
16017  */
16018 
16019 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
16020  Py_ssize_t __pyx_v_suboffset;
16021  PyObject *__pyx_r = NULL;
16022  __Pyx_TraceDeclarations
16023  __Pyx_RefNannyDeclarations
16024  Py_ssize_t *__pyx_t_1;
16025  Py_ssize_t *__pyx_t_2;
16026  Py_ssize_t *__pyx_t_3;
16027  int __pyx_t_4;
16028  PyObject *__pyx_t_5 = NULL;
16029  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
16030  __Pyx_TraceCall("assert_direct_dimensions", __pyx_f[1], 696, 0, __PYX_ERR(1, 696, __pyx_L1_error));
16031 
16032  /* "View.MemoryView":697
16033  *
16034  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
16035  * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
16036  * if suboffset >= 0:
16037  * raise ValueError("Indirect dimensions not supported")
16038  */
16039  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
16040  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
16041  __pyx_t_1 = __pyx_t_3;
16042  __pyx_v_suboffset = (__pyx_t_1[0]);
16043 
16044  /* "View.MemoryView":698
16045  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
16046  * for suboffset in suboffsets[:ndim]:
16047  * if suboffset >= 0: # <<<<<<<<<<<<<<
16048  * raise ValueError("Indirect dimensions not supported")
16049  *
16050  */
16051  __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
16052  if (unlikely(__pyx_t_4)) {
16053 
16054  /* "View.MemoryView":699
16055  * for suboffset in suboffsets[:ndim]:
16056  * if suboffset >= 0:
16057  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
16058  *
16059  *
16060  */
16061  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 699, __pyx_L1_error)
16062  __Pyx_GOTREF(__pyx_t_5);
16063  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
16064  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16065  __PYX_ERR(1, 699, __pyx_L1_error)
16066 
16067  /* "View.MemoryView":698
16068  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
16069  * for suboffset in suboffsets[:ndim]:
16070  * if suboffset >= 0: # <<<<<<<<<<<<<<
16071  * raise ValueError("Indirect dimensions not supported")
16072  *
16073  */
16074  }
16075  }
16076 
16077  /* "View.MemoryView":696
16078  * return have_slices or nslices, tuple(result)
16079  *
16080  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
16081  * for suboffset in suboffsets[:ndim]:
16082  * if suboffset >= 0:
16083  */
16084 
16085  /* function exit code */
16086  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16087  goto __pyx_L0;
16088  __pyx_L1_error:;
16089  __Pyx_XDECREF(__pyx_t_5);
16090  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
16091  __pyx_r = 0;
16092  __pyx_L0:;
16093  __Pyx_XGIVEREF(__pyx_r);
16094  __Pyx_TraceReturn(__pyx_r, 0);
16095  __Pyx_RefNannyFinishContext();
16096  return __pyx_r;
16097 }
16098 
16099 /* "View.MemoryView":706
16100  *
16101  * @cname('__pyx_memview_slice')
16102  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
16103  * cdef int new_ndim = 0, suboffset_dim = -1, dim
16104  * cdef bint negative_step
16105  */
16106 
16107 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
16108  int __pyx_v_new_ndim;
16109  int __pyx_v_suboffset_dim;
16110  int __pyx_v_dim;
16111  __Pyx_memviewslice __pyx_v_src;
16112  __Pyx_memviewslice __pyx_v_dst;
16113  __Pyx_memviewslice *__pyx_v_p_src;
16114  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
16115  __Pyx_memviewslice *__pyx_v_p_dst;
16116  int *__pyx_v_p_suboffset_dim;
16117  Py_ssize_t __pyx_v_start;
16118  Py_ssize_t __pyx_v_stop;
16119  Py_ssize_t __pyx_v_step;
16120  int __pyx_v_have_start;
16121  int __pyx_v_have_stop;
16122  int __pyx_v_have_step;
16123  PyObject *__pyx_v_index = NULL;
16124  struct __pyx_memoryview_obj *__pyx_r = NULL;
16125  __Pyx_TraceDeclarations
16126  __Pyx_RefNannyDeclarations
16127  int __pyx_t_1;
16128  int __pyx_t_2;
16129  PyObject *__pyx_t_3 = NULL;
16130  struct __pyx_memoryview_obj *__pyx_t_4;
16131  char *__pyx_t_5;
16132  int __pyx_t_6;
16133  Py_ssize_t __pyx_t_7;
16134  PyObject *(*__pyx_t_8)(PyObject *);
16135  PyObject *__pyx_t_9 = NULL;
16136  Py_ssize_t __pyx_t_10;
16137  int __pyx_t_11;
16138  Py_ssize_t __pyx_t_12;
16139  __Pyx_RefNannySetupContext("memview_slice", 0);
16140  __Pyx_TraceCall("memview_slice", __pyx_f[1], 706, 0, __PYX_ERR(1, 706, __pyx_L1_error));
16141 
16142  /* "View.MemoryView":707
16143  * @cname('__pyx_memview_slice')
16144  * cdef memoryview memview_slice(memoryview memview, object indices):
16145  * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
16146  * cdef bint negative_step
16147  * cdef __Pyx_memviewslice src, dst
16148  */
16149  __pyx_v_new_ndim = 0;
16150  __pyx_v_suboffset_dim = -1;
16151 
16152  /* "View.MemoryView":714
16153  *
16154  *
16155  * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
16156  *
16157  * cdef _memoryviewslice memviewsliceobj
16158  */
16159  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
16160 
16161  /* "View.MemoryView":718
16162  * cdef _memoryviewslice memviewsliceobj
16163  *
16164  * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
16165  *
16166  * if isinstance(memview, _memoryviewslice):
16167  */
16168  #ifndef CYTHON_WITHOUT_ASSERTIONS
16169  if (unlikely(!Py_OptimizeFlag)) {
16170  if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
16171  PyErr_SetNone(PyExc_AssertionError);
16172  __PYX_ERR(1, 718, __pyx_L1_error)
16173  }
16174  }
16175  #endif
16176 
16177  /* "View.MemoryView":720
16178  * assert memview.view.ndim > 0
16179  *
16180  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16181  * memviewsliceobj = memview
16182  * p_src = &memviewsliceobj.from_slice
16183  */
16184  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16185  __pyx_t_2 = (__pyx_t_1 != 0);
16186  if (__pyx_t_2) {
16187 
16188  /* "View.MemoryView":721
16189  *
16190  * if isinstance(memview, _memoryviewslice):
16191  * memviewsliceobj = memview # <<<<<<<<<<<<<<
16192  * p_src = &memviewsliceobj.from_slice
16193  * else:
16194  */
16195  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 721, __pyx_L1_error)
16196  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
16197  __Pyx_INCREF(__pyx_t_3);
16198  __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
16199  __pyx_t_3 = 0;
16200 
16201  /* "View.MemoryView":722
16202  * if isinstance(memview, _memoryviewslice):
16203  * memviewsliceobj = memview
16204  * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
16205  * else:
16206  * slice_copy(memview, &src)
16207  */
16208  __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
16209 
16210  /* "View.MemoryView":720
16211  * assert memview.view.ndim > 0
16212  *
16213  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16214  * memviewsliceobj = memview
16215  * p_src = &memviewsliceobj.from_slice
16216  */
16217  goto __pyx_L3;
16218  }
16219 
16220  /* "View.MemoryView":724
16221  * p_src = &memviewsliceobj.from_slice
16222  * else:
16223  * slice_copy(memview, &src) # <<<<<<<<<<<<<<
16224  * p_src = &src
16225  *
16226  */
16227  /*else*/ {
16228  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
16229 
16230  /* "View.MemoryView":725
16231  * else:
16232  * slice_copy(memview, &src)
16233  * p_src = &src # <<<<<<<<<<<<<<
16234  *
16235  *
16236  */
16237  __pyx_v_p_src = (&__pyx_v_src);
16238  }
16239  __pyx_L3:;
16240 
16241  /* "View.MemoryView":731
16242  *
16243  *
16244  * dst.memview = p_src.memview # <<<<<<<<<<<<<<
16245  * dst.data = p_src.data
16246  *
16247  */
16248  __pyx_t_4 = __pyx_v_p_src->memview;
16249  __pyx_v_dst.memview = __pyx_t_4;
16250 
16251  /* "View.MemoryView":732
16252  *
16253  * dst.memview = p_src.memview
16254  * dst.data = p_src.data # <<<<<<<<<<<<<<
16255  *
16256  *
16257  */
16258  __pyx_t_5 = __pyx_v_p_src->data;
16259  __pyx_v_dst.data = __pyx_t_5;
16260 
16261  /* "View.MemoryView":737
16262  *
16263  *
16264  * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
16265  * cdef int *p_suboffset_dim = &suboffset_dim
16266  * cdef Py_ssize_t start, stop, step
16267  */
16268  __pyx_v_p_dst = (&__pyx_v_dst);
16269 
16270  /* "View.MemoryView":738
16271  *
16272  * cdef __Pyx_memviewslice *p_dst = &dst
16273  * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
16274  * cdef Py_ssize_t start, stop, step
16275  * cdef bint have_start, have_stop, have_step
16276  */
16277  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
16278 
16279  /* "View.MemoryView":742
16280  * cdef bint have_start, have_stop, have_step
16281  *
16282  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
16283  * if PyIndex_Check(index):
16284  * slice_memviewslice(
16285  */
16286  __pyx_t_6 = 0;
16287  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
16288  __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
16289  __pyx_t_8 = NULL;
16290  } else {
16291  __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 742, __pyx_L1_error)
16292  __Pyx_GOTREF(__pyx_t_3);
16293  __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 742, __pyx_L1_error)
16294  }
16295  for (;;) {
16296  if (likely(!__pyx_t_8)) {
16297  if (likely(PyList_CheckExact(__pyx_t_3))) {
16298  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
16299  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16300  __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 742, __pyx_L1_error)
16301  #else
16302  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 742, __pyx_L1_error)
16303  __Pyx_GOTREF(__pyx_t_9);
16304  #endif
16305  } else {
16306  if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
16307  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16308  __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 742, __pyx_L1_error)
16309  #else
16310  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 742, __pyx_L1_error)
16311  __Pyx_GOTREF(__pyx_t_9);
16312  #endif
16313  }
16314  } else {
16315  __pyx_t_9 = __pyx_t_8(__pyx_t_3);
16316  if (unlikely(!__pyx_t_9)) {
16317  PyObject* exc_type = PyErr_Occurred();
16318  if (exc_type) {
16319  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
16320  else __PYX_ERR(1, 742, __pyx_L1_error)
16321  }
16322  break;
16323  }
16324  __Pyx_GOTREF(__pyx_t_9);
16325  }
16326  __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
16327  __pyx_t_9 = 0;
16328  __pyx_v_dim = __pyx_t_6;
16329  __pyx_t_6 = (__pyx_t_6 + 1);
16330 
16331  /* "View.MemoryView":743
16332  *
16333  * for dim, index in enumerate(indices):
16334  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
16335  * slice_memviewslice(
16336  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
16337  */
16338  __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
16339  if (__pyx_t_2) {
16340 
16341  /* "View.MemoryView":747
16342  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
16343  * dim, new_ndim, p_suboffset_dim,
16344  * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
16345  * 0, 0, 0, # have_{start,stop,step}
16346  * False)
16347  */
16348  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 747, __pyx_L1_error)
16349 
16350  /* "View.MemoryView":744
16351  * for dim, index in enumerate(indices):
16352  * if PyIndex_Check(index):
16353  * slice_memviewslice( # <<<<<<<<<<<<<<
16354  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
16355  * dim, new_ndim, p_suboffset_dim,
16356  */
16357  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 744, __pyx_L1_error)
16358 
16359  /* "View.MemoryView":743
16360  *
16361  * for dim, index in enumerate(indices):
16362  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
16363  * slice_memviewslice(
16364  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
16365  */
16366  goto __pyx_L6;
16367  }
16368 
16369  /* "View.MemoryView":750
16370  * 0, 0, 0, # have_{start,stop,step}
16371  * False)
16372  * elif index is None: # <<<<<<<<<<<<<<
16373  * p_dst.shape[new_ndim] = 1
16374  * p_dst.strides[new_ndim] = 0
16375  */
16376  __pyx_t_2 = (__pyx_v_index == Py_None);
16377  __pyx_t_1 = (__pyx_t_2 != 0);
16378  if (__pyx_t_1) {
16379 
16380  /* "View.MemoryView":751
16381  * False)
16382  * elif index is None:
16383  * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
16384  * p_dst.strides[new_ndim] = 0
16385  * p_dst.suboffsets[new_ndim] = -1
16386  */
16387  (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
16388 
16389  /* "View.MemoryView":752
16390  * elif index is None:
16391  * p_dst.shape[new_ndim] = 1
16392  * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
16393  * p_dst.suboffsets[new_ndim] = -1
16394  * new_ndim += 1
16395  */
16396  (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
16397 
16398  /* "View.MemoryView":753
16399  * p_dst.shape[new_ndim] = 1
16400  * p_dst.strides[new_ndim] = 0
16401  * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
16402  * new_ndim += 1
16403  * else:
16404  */
16405  (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
16406 
16407  /* "View.MemoryView":754
16408  * p_dst.strides[new_ndim] = 0
16409  * p_dst.suboffsets[new_ndim] = -1
16410  * new_ndim += 1 # <<<<<<<<<<<<<<
16411  * else:
16412  * start = index.start or 0
16413  */
16414  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
16415 
16416  /* "View.MemoryView":750
16417  * 0, 0, 0, # have_{start,stop,step}
16418  * False)
16419  * elif index is None: # <<<<<<<<<<<<<<
16420  * p_dst.shape[new_ndim] = 1
16421  * p_dst.strides[new_ndim] = 0
16422  */
16423  goto __pyx_L6;
16424  }
16425 
16426  /* "View.MemoryView":756
16427  * new_ndim += 1
16428  * else:
16429  * start = index.start or 0 # <<<<<<<<<<<<<<
16430  * stop = index.stop or 0
16431  * step = index.step or 0
16432  */
16433  /*else*/ {
16434  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 756, __pyx_L1_error)
16435  __Pyx_GOTREF(__pyx_t_9);
16436  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 756, __pyx_L1_error)
16437  if (!__pyx_t_1) {
16438  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16439  } else {
16440  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 756, __pyx_L1_error)
16441  __pyx_t_10 = __pyx_t_12;
16442  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16443  goto __pyx_L7_bool_binop_done;
16444  }
16445  __pyx_t_10 = 0;
16446  __pyx_L7_bool_binop_done:;
16447  __pyx_v_start = __pyx_t_10;
16448 
16449  /* "View.MemoryView":757
16450  * else:
16451  * start = index.start or 0
16452  * stop = index.stop or 0 # <<<<<<<<<<<<<<
16453  * step = index.step or 0
16454  *
16455  */
16456  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 757, __pyx_L1_error)
16457  __Pyx_GOTREF(__pyx_t_9);
16458  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 757, __pyx_L1_error)
16459  if (!__pyx_t_1) {
16460  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16461  } else {
16462  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 757, __pyx_L1_error)
16463  __pyx_t_10 = __pyx_t_12;
16464  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16465  goto __pyx_L9_bool_binop_done;
16466  }
16467  __pyx_t_10 = 0;
16468  __pyx_L9_bool_binop_done:;
16469  __pyx_v_stop = __pyx_t_10;
16470 
16471  /* "View.MemoryView":758
16472  * start = index.start or 0
16473  * stop = index.stop or 0
16474  * step = index.step or 0 # <<<<<<<<<<<<<<
16475  *
16476  * have_start = index.start is not None
16477  */
16478  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 758, __pyx_L1_error)
16479  __Pyx_GOTREF(__pyx_t_9);
16480  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 758, __pyx_L1_error)
16481  if (!__pyx_t_1) {
16482  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16483  } else {
16484  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 758, __pyx_L1_error)
16485  __pyx_t_10 = __pyx_t_12;
16486  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16487  goto __pyx_L11_bool_binop_done;
16488  }
16489  __pyx_t_10 = 0;
16490  __pyx_L11_bool_binop_done:;
16491  __pyx_v_step = __pyx_t_10;
16492 
16493  /* "View.MemoryView":760
16494  * step = index.step or 0
16495  *
16496  * have_start = index.start is not None # <<<<<<<<<<<<<<
16497  * have_stop = index.stop is not None
16498  * have_step = index.step is not None
16499  */
16500  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
16501  __Pyx_GOTREF(__pyx_t_9);
16502  __pyx_t_1 = (__pyx_t_9 != Py_None);
16503  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16504  __pyx_v_have_start = __pyx_t_1;
16505 
16506  /* "View.MemoryView":761
16507  *
16508  * have_start = index.start is not None
16509  * have_stop = index.stop is not None # <<<<<<<<<<<<<<
16510  * have_step = index.step is not None
16511  *
16512  */
16513  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
16514  __Pyx_GOTREF(__pyx_t_9);
16515  __pyx_t_1 = (__pyx_t_9 != Py_None);
16516  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16517  __pyx_v_have_stop = __pyx_t_1;
16518 
16519  /* "View.MemoryView":762
16520  * have_start = index.start is not None
16521  * have_stop = index.stop is not None
16522  * have_step = index.step is not None # <<<<<<<<<<<<<<
16523  *
16524  * slice_memviewslice(
16525  */
16526  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
16527  __Pyx_GOTREF(__pyx_t_9);
16528  __pyx_t_1 = (__pyx_t_9 != Py_None);
16529  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16530  __pyx_v_have_step = __pyx_t_1;
16531 
16532  /* "View.MemoryView":764
16533  * have_step = index.step is not None
16534  *
16535  * slice_memviewslice( # <<<<<<<<<<<<<<
16536  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
16537  * dim, new_ndim, p_suboffset_dim,
16538  */
16539  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 764, __pyx_L1_error)
16540 
16541  /* "View.MemoryView":770
16542  * have_start, have_stop, have_step,
16543  * True)
16544  * new_ndim += 1 # <<<<<<<<<<<<<<
16545  *
16546  * if isinstance(memview, _memoryviewslice):
16547  */
16548  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
16549  }
16550  __pyx_L6:;
16551 
16552  /* "View.MemoryView":742
16553  * cdef bint have_start, have_stop, have_step
16554  *
16555  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
16556  * if PyIndex_Check(index):
16557  * slice_memviewslice(
16558  */
16559  }
16560  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16561 
16562  /* "View.MemoryView":772
16563  * new_ndim += 1
16564  *
16565  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16566  * return memoryview_fromslice(dst, new_ndim,
16567  * memviewsliceobj.to_object_func,
16568  */
16569  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16570  __pyx_t_2 = (__pyx_t_1 != 0);
16571  if (__pyx_t_2) {
16572 
16573  /* "View.MemoryView":773
16574  *
16575  * if isinstance(memview, _memoryviewslice):
16576  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
16577  * memviewsliceobj.to_object_func,
16578  * memviewsliceobj.to_dtype_func,
16579  */
16580  __Pyx_XDECREF(((PyObject *)__pyx_r));
16581 
16582  /* "View.MemoryView":774
16583  * if isinstance(memview, _memoryviewslice):
16584  * return memoryview_fromslice(dst, new_ndim,
16585  * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
16586  * memviewsliceobj.to_dtype_func,
16587  * memview.dtype_is_object)
16588  */
16589  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 774, __pyx_L1_error) }
16590 
16591  /* "View.MemoryView":775
16592  * return memoryview_fromslice(dst, new_ndim,
16593  * memviewsliceobj.to_object_func,
16594  * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
16595  * memview.dtype_is_object)
16596  * else:
16597  */
16598  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 775, __pyx_L1_error) }
16599 
16600  /* "View.MemoryView":773
16601  *
16602  * if isinstance(memview, _memoryviewslice):
16603  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
16604  * memviewsliceobj.to_object_func,
16605  * memviewsliceobj.to_dtype_func,
16606  */
16607  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 773, __pyx_L1_error)
16608  __Pyx_GOTREF(__pyx_t_3);
16609  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 773, __pyx_L1_error)
16610  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
16611  __pyx_t_3 = 0;
16612  goto __pyx_L0;
16613 
16614  /* "View.MemoryView":772
16615  * new_ndim += 1
16616  *
16617  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16618  * return memoryview_fromslice(dst, new_ndim,
16619  * memviewsliceobj.to_object_func,
16620  */
16621  }
16622 
16623  /* "View.MemoryView":778
16624  * memview.dtype_is_object)
16625  * else:
16626  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
16627  * memview.dtype_is_object)
16628  *
16629  */
16630  /*else*/ {
16631  __Pyx_XDECREF(((PyObject *)__pyx_r));
16632 
16633  /* "View.MemoryView":779
16634  * else:
16635  * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
16636  * memview.dtype_is_object) # <<<<<<<<<<<<<<
16637  *
16638  *
16639  */
16640  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 778, __pyx_L1_error)
16641  __Pyx_GOTREF(__pyx_t_3);
16642 
16643  /* "View.MemoryView":778
16644  * memview.dtype_is_object)
16645  * else:
16646  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
16647  * memview.dtype_is_object)
16648  *
16649  */
16650  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 778, __pyx_L1_error)
16651  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
16652  __pyx_t_3 = 0;
16653  goto __pyx_L0;
16654  }
16655 
16656  /* "View.MemoryView":706
16657  *
16658  * @cname('__pyx_memview_slice')
16659  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
16660  * cdef int new_ndim = 0, suboffset_dim = -1, dim
16661  * cdef bint negative_step
16662  */
16663 
16664  /* function exit code */
16665  __pyx_L1_error:;
16666  __Pyx_XDECREF(__pyx_t_3);
16667  __Pyx_XDECREF(__pyx_t_9);
16668  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16669  __pyx_r = 0;
16670  __pyx_L0:;
16671  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
16672  __Pyx_XDECREF(__pyx_v_index);
16673  __Pyx_XGIVEREF((PyObject *)__pyx_r);
16674  __Pyx_TraceReturn(__pyx_r, 0);
16675  __Pyx_RefNannyFinishContext();
16676  return __pyx_r;
16677 }
16678 
16679 /* "View.MemoryView":803
16680  *
16681  * @cname('__pyx_memoryview_slice_memviewslice')
16682  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
16683  * __Pyx_memviewslice *dst,
16684  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
16685  */
16686 
16687 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
16688  Py_ssize_t __pyx_v_new_shape;
16689  int __pyx_v_negative_step;
16690  int __pyx_r;
16691  __Pyx_TraceDeclarations
16692  int __pyx_t_1;
16693  int __pyx_t_2;
16694  int __pyx_t_3;
16695  __Pyx_TraceCall("slice_memviewslice", __pyx_f[1], 803, 1, __PYX_ERR(1, 803, __pyx_L1_error));
16696 
16697  /* "View.MemoryView":823
16698  * cdef bint negative_step
16699  *
16700  * if not is_slice: # <<<<<<<<<<<<<<
16701  *
16702  * if start < 0:
16703  */
16704  __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
16705  if (__pyx_t_1) {
16706 
16707  /* "View.MemoryView":825
16708  * if not is_slice:
16709  *
16710  * if start < 0: # <<<<<<<<<<<<<<
16711  * start += shape
16712  * if not 0 <= start < shape:
16713  */
16714  __pyx_t_1 = ((__pyx_v_start < 0) != 0);
16715  if (__pyx_t_1) {
16716 
16717  /* "View.MemoryView":826
16718  *
16719  * if start < 0:
16720  * start += shape # <<<<<<<<<<<<<<
16721  * if not 0 <= start < shape:
16722  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
16723  */
16724  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16725 
16726  /* "View.MemoryView":825
16727  * if not is_slice:
16728  *
16729  * if start < 0: # <<<<<<<<<<<<<<
16730  * start += shape
16731  * if not 0 <= start < shape:
16732  */
16733  }
16734 
16735  /* "View.MemoryView":827
16736  * if start < 0:
16737  * start += shape
16738  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
16739  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
16740  * else:
16741  */
16742  __pyx_t_1 = (0 <= __pyx_v_start);
16743  if (__pyx_t_1) {
16744  __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
16745  }
16746  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
16747  if (__pyx_t_2) {
16748 
16749  /* "View.MemoryView":828
16750  * start += shape
16751  * if not 0 <= start < shape:
16752  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
16753  * else:
16754  *
16755  */
16756  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 828, __pyx_L1_error)
16757 
16758  /* "View.MemoryView":827
16759  * if start < 0:
16760  * start += shape
16761  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
16762  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
16763  * else:
16764  */
16765  }
16766 
16767  /* "View.MemoryView":823
16768  * cdef bint negative_step
16769  *
16770  * if not is_slice: # <<<<<<<<<<<<<<
16771  *
16772  * if start < 0:
16773  */
16774  goto __pyx_L3;
16775  }
16776 
16777  /* "View.MemoryView":831
16778  * else:
16779  *
16780  * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
16781  *
16782  * if have_step and step == 0:
16783  */
16784  /*else*/ {
16785  __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
16786  if (__pyx_t_1) {
16787  } else {
16788  __pyx_t_2 = __pyx_t_1;
16789  goto __pyx_L6_bool_binop_done;
16790  }
16791  __pyx_t_1 = ((__pyx_v_step < 0) != 0);
16792  __pyx_t_2 = __pyx_t_1;
16793  __pyx_L6_bool_binop_done:;
16794  __pyx_v_negative_step = __pyx_t_2;
16795 
16796  /* "View.MemoryView":833
16797  * negative_step = have_step != 0 and step < 0
16798  *
16799  * if have_step and step == 0: # <<<<<<<<<<<<<<
16800  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
16801  *
16802  */
16803  __pyx_t_1 = (__pyx_v_have_step != 0);
16804  if (__pyx_t_1) {
16805  } else {
16806  __pyx_t_2 = __pyx_t_1;
16807  goto __pyx_L9_bool_binop_done;
16808  }
16809  __pyx_t_1 = ((__pyx_v_step == 0) != 0);
16810  __pyx_t_2 = __pyx_t_1;
16811  __pyx_L9_bool_binop_done:;
16812  if (__pyx_t_2) {
16813 
16814  /* "View.MemoryView":834
16815  *
16816  * if have_step and step == 0:
16817  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
16818  *
16819  *
16820  */
16821  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 834, __pyx_L1_error)
16822 
16823  /* "View.MemoryView":833
16824  * negative_step = have_step != 0 and step < 0
16825  *
16826  * if have_step and step == 0: # <<<<<<<<<<<<<<
16827  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
16828  *
16829  */
16830  }
16831 
16832  /* "View.MemoryView":837
16833  *
16834  *
16835  * if have_start: # <<<<<<<<<<<<<<
16836  * if start < 0:
16837  * start += shape
16838  */
16839  __pyx_t_2 = (__pyx_v_have_start != 0);
16840  if (__pyx_t_2) {
16841 
16842  /* "View.MemoryView":838
16843  *
16844  * if have_start:
16845  * if start < 0: # <<<<<<<<<<<<<<
16846  * start += shape
16847  * if start < 0:
16848  */
16849  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16850  if (__pyx_t_2) {
16851 
16852  /* "View.MemoryView":839
16853  * if have_start:
16854  * if start < 0:
16855  * start += shape # <<<<<<<<<<<<<<
16856  * if start < 0:
16857  * start = 0
16858  */
16859  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16860 
16861  /* "View.MemoryView":840
16862  * if start < 0:
16863  * start += shape
16864  * if start < 0: # <<<<<<<<<<<<<<
16865  * start = 0
16866  * elif start >= shape:
16867  */
16868  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16869  if (__pyx_t_2) {
16870 
16871  /* "View.MemoryView":841
16872  * start += shape
16873  * if start < 0:
16874  * start = 0 # <<<<<<<<<<<<<<
16875  * elif start >= shape:
16876  * if negative_step:
16877  */
16878  __pyx_v_start = 0;
16879 
16880  /* "View.MemoryView":840
16881  * if start < 0:
16882  * start += shape
16883  * if start < 0: # <<<<<<<<<<<<<<
16884  * start = 0
16885  * elif start >= shape:
16886  */
16887  }
16888 
16889  /* "View.MemoryView":838
16890  *
16891  * if have_start:
16892  * if start < 0: # <<<<<<<<<<<<<<
16893  * start += shape
16894  * if start < 0:
16895  */
16896  goto __pyx_L12;
16897  }
16898 
16899  /* "View.MemoryView":842
16900  * if start < 0:
16901  * start = 0
16902  * elif start >= shape: # <<<<<<<<<<<<<<
16903  * if negative_step:
16904  * start = shape - 1
16905  */
16906  __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
16907  if (__pyx_t_2) {
16908 
16909  /* "View.MemoryView":843
16910  * start = 0
16911  * elif start >= shape:
16912  * if negative_step: # <<<<<<<<<<<<<<
16913  * start = shape - 1
16914  * else:
16915  */
16916  __pyx_t_2 = (__pyx_v_negative_step != 0);
16917  if (__pyx_t_2) {
16918 
16919  /* "View.MemoryView":844
16920  * elif start >= shape:
16921  * if negative_step:
16922  * start = shape - 1 # <<<<<<<<<<<<<<
16923  * else:
16924  * start = shape
16925  */
16926  __pyx_v_start = (__pyx_v_shape - 1);
16927 
16928  /* "View.MemoryView":843
16929  * start = 0
16930  * elif start >= shape:
16931  * if negative_step: # <<<<<<<<<<<<<<
16932  * start = shape - 1
16933  * else:
16934  */
16935  goto __pyx_L14;
16936  }
16937 
16938  /* "View.MemoryView":846
16939  * start = shape - 1
16940  * else:
16941  * start = shape # <<<<<<<<<<<<<<
16942  * else:
16943  * if negative_step:
16944  */
16945  /*else*/ {
16946  __pyx_v_start = __pyx_v_shape;
16947  }
16948  __pyx_L14:;
16949 
16950  /* "View.MemoryView":842
16951  * if start < 0:
16952  * start = 0
16953  * elif start >= shape: # <<<<<<<<<<<<<<
16954  * if negative_step:
16955  * start = shape - 1
16956  */
16957  }
16958  __pyx_L12:;
16959 
16960  /* "View.MemoryView":837
16961  *
16962  *
16963  * if have_start: # <<<<<<<<<<<<<<
16964  * if start < 0:
16965  * start += shape
16966  */
16967  goto __pyx_L11;
16968  }
16969 
16970  /* "View.MemoryView":848
16971  * start = shape
16972  * else:
16973  * if negative_step: # <<<<<<<<<<<<<<
16974  * start = shape - 1
16975  * else:
16976  */
16977  /*else*/ {
16978  __pyx_t_2 = (__pyx_v_negative_step != 0);
16979  if (__pyx_t_2) {
16980 
16981  /* "View.MemoryView":849
16982  * else:
16983  * if negative_step:
16984  * start = shape - 1 # <<<<<<<<<<<<<<
16985  * else:
16986  * start = 0
16987  */
16988  __pyx_v_start = (__pyx_v_shape - 1);
16989 
16990  /* "View.MemoryView":848
16991  * start = shape
16992  * else:
16993  * if negative_step: # <<<<<<<<<<<<<<
16994  * start = shape - 1
16995  * else:
16996  */
16997  goto __pyx_L15;
16998  }
16999 
17000  /* "View.MemoryView":851
17001  * start = shape - 1
17002  * else:
17003  * start = 0 # <<<<<<<<<<<<<<
17004  *
17005  * if have_stop:
17006  */
17007  /*else*/ {
17008  __pyx_v_start = 0;
17009  }
17010  __pyx_L15:;
17011  }
17012  __pyx_L11:;
17013 
17014  /* "View.MemoryView":853
17015  * start = 0
17016  *
17017  * if have_stop: # <<<<<<<<<<<<<<
17018  * if stop < 0:
17019  * stop += shape
17020  */
17021  __pyx_t_2 = (__pyx_v_have_stop != 0);
17022  if (__pyx_t_2) {
17023 
17024  /* "View.MemoryView":854
17025  *
17026  * if have_stop:
17027  * if stop < 0: # <<<<<<<<<<<<<<
17028  * stop += shape
17029  * if stop < 0:
17030  */
17031  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
17032  if (__pyx_t_2) {
17033 
17034  /* "View.MemoryView":855
17035  * if have_stop:
17036  * if stop < 0:
17037  * stop += shape # <<<<<<<<<<<<<<
17038  * if stop < 0:
17039  * stop = 0
17040  */
17041  __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
17042 
17043  /* "View.MemoryView":856
17044  * if stop < 0:
17045  * stop += shape
17046  * if stop < 0: # <<<<<<<<<<<<<<
17047  * stop = 0
17048  * elif stop > shape:
17049  */
17050  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
17051  if (__pyx_t_2) {
17052 
17053  /* "View.MemoryView":857
17054  * stop += shape
17055  * if stop < 0:
17056  * stop = 0 # <<<<<<<<<<<<<<
17057  * elif stop > shape:
17058  * stop = shape
17059  */
17060  __pyx_v_stop = 0;
17061 
17062  /* "View.MemoryView":856
17063  * if stop < 0:
17064  * stop += shape
17065  * if stop < 0: # <<<<<<<<<<<<<<
17066  * stop = 0
17067  * elif stop > shape:
17068  */
17069  }
17070 
17071  /* "View.MemoryView":854
17072  *
17073  * if have_stop:
17074  * if stop < 0: # <<<<<<<<<<<<<<
17075  * stop += shape
17076  * if stop < 0:
17077  */
17078  goto __pyx_L17;
17079  }
17080 
17081  /* "View.MemoryView":858
17082  * if stop < 0:
17083  * stop = 0
17084  * elif stop > shape: # <<<<<<<<<<<<<<
17085  * stop = shape
17086  * else:
17087  */
17088  __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
17089  if (__pyx_t_2) {
17090 
17091  /* "View.MemoryView":859
17092  * stop = 0
17093  * elif stop > shape:
17094  * stop = shape # <<<<<<<<<<<<<<
17095  * else:
17096  * if negative_step:
17097  */
17098  __pyx_v_stop = __pyx_v_shape;
17099 
17100  /* "View.MemoryView":858
17101  * if stop < 0:
17102  * stop = 0
17103  * elif stop > shape: # <<<<<<<<<<<<<<
17104  * stop = shape
17105  * else:
17106  */
17107  }
17108  __pyx_L17:;
17109 
17110  /* "View.MemoryView":853
17111  * start = 0
17112  *
17113  * if have_stop: # <<<<<<<<<<<<<<
17114  * if stop < 0:
17115  * stop += shape
17116  */
17117  goto __pyx_L16;
17118  }
17119 
17120  /* "View.MemoryView":861
17121  * stop = shape
17122  * else:
17123  * if negative_step: # <<<<<<<<<<<<<<
17124  * stop = -1
17125  * else:
17126  */
17127  /*else*/ {
17128  __pyx_t_2 = (__pyx_v_negative_step != 0);
17129  if (__pyx_t_2) {
17130 
17131  /* "View.MemoryView":862
17132  * else:
17133  * if negative_step:
17134  * stop = -1 # <<<<<<<<<<<<<<
17135  * else:
17136  * stop = shape
17137  */
17138  __pyx_v_stop = -1L;
17139 
17140  /* "View.MemoryView":861
17141  * stop = shape
17142  * else:
17143  * if negative_step: # <<<<<<<<<<<<<<
17144  * stop = -1
17145  * else:
17146  */
17147  goto __pyx_L19;
17148  }
17149 
17150  /* "View.MemoryView":864
17151  * stop = -1
17152  * else:
17153  * stop = shape # <<<<<<<<<<<<<<
17154  *
17155  * if not have_step:
17156  */
17157  /*else*/ {
17158  __pyx_v_stop = __pyx_v_shape;
17159  }
17160  __pyx_L19:;
17161  }
17162  __pyx_L16:;
17163 
17164  /* "View.MemoryView":866
17165  * stop = shape
17166  *
17167  * if not have_step: # <<<<<<<<<<<<<<
17168  * step = 1
17169  *
17170  */
17171  __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
17172  if (__pyx_t_2) {
17173 
17174  /* "View.MemoryView":867
17175  *
17176  * if not have_step:
17177  * step = 1 # <<<<<<<<<<<<<<
17178  *
17179  *
17180  */
17181  __pyx_v_step = 1;
17182 
17183  /* "View.MemoryView":866
17184  * stop = shape
17185  *
17186  * if not have_step: # <<<<<<<<<<<<<<
17187  * step = 1
17188  *
17189  */
17190  }
17191 
17192  /* "View.MemoryView":871
17193  *
17194  * with cython.cdivision(True):
17195  * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
17196  *
17197  * if (stop - start) - step * new_shape:
17198  */
17199  __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
17200 
17201  /* "View.MemoryView":873
17202  * new_shape = (stop - start) // step
17203  *
17204  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
17205  * new_shape += 1
17206  *
17207  */
17208  __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
17209  if (__pyx_t_2) {
17210 
17211  /* "View.MemoryView":874
17212  *
17213  * if (stop - start) - step * new_shape:
17214  * new_shape += 1 # <<<<<<<<<<<<<<
17215  *
17216  * if new_shape < 0:
17217  */
17218  __pyx_v_new_shape = (__pyx_v_new_shape + 1);
17219 
17220  /* "View.MemoryView":873
17221  * new_shape = (stop - start) // step
17222  *
17223  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
17224  * new_shape += 1
17225  *
17226  */
17227  }
17228 
17229  /* "View.MemoryView":876
17230  * new_shape += 1
17231  *
17232  * if new_shape < 0: # <<<<<<<<<<<<<<
17233  * new_shape = 0
17234  *
17235  */
17236  __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
17237  if (__pyx_t_2) {
17238 
17239  /* "View.MemoryView":877
17240  *
17241  * if new_shape < 0:
17242  * new_shape = 0 # <<<<<<<<<<<<<<
17243  *
17244  *
17245  */
17246  __pyx_v_new_shape = 0;
17247 
17248  /* "View.MemoryView":876
17249  * new_shape += 1
17250  *
17251  * if new_shape < 0: # <<<<<<<<<<<<<<
17252  * new_shape = 0
17253  *
17254  */
17255  }
17256 
17257  /* "View.MemoryView":880
17258  *
17259  *
17260  * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
17261  * dst.shape[new_ndim] = new_shape
17262  * dst.suboffsets[new_ndim] = suboffset
17263  */
17264  (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
17265 
17266  /* "View.MemoryView":881
17267  *
17268  * dst.strides[new_ndim] = stride * step
17269  * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
17270  * dst.suboffsets[new_ndim] = suboffset
17271  *
17272  */
17273  (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
17274 
17275  /* "View.MemoryView":882
17276  * dst.strides[new_ndim] = stride * step
17277  * dst.shape[new_ndim] = new_shape
17278  * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
17279  *
17280  *
17281  */
17282  (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
17283  }
17284  __pyx_L3:;
17285 
17286  /* "View.MemoryView":885
17287  *
17288  *
17289  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
17290  * dst.data += start * stride
17291  * else:
17292  */
17293  __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
17294  if (__pyx_t_2) {
17295 
17296  /* "View.MemoryView":886
17297  *
17298  * if suboffset_dim[0] < 0:
17299  * dst.data += start * stride # <<<<<<<<<<<<<<
17300  * else:
17301  * dst.suboffsets[suboffset_dim[0]] += start * stride
17302  */
17303  __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
17304 
17305  /* "View.MemoryView":885
17306  *
17307  *
17308  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
17309  * dst.data += start * stride
17310  * else:
17311  */
17312  goto __pyx_L23;
17313  }
17314 
17315  /* "View.MemoryView":888
17316  * dst.data += start * stride
17317  * else:
17318  * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
17319  *
17320  * if suboffset >= 0:
17321  */
17322  /*else*/ {
17323  __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
17324  (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
17325  }
17326  __pyx_L23:;
17327 
17328  /* "View.MemoryView":890
17329  * dst.suboffsets[suboffset_dim[0]] += start * stride
17330  *
17331  * if suboffset >= 0: # <<<<<<<<<<<<<<
17332  * if not is_slice:
17333  * if new_ndim == 0:
17334  */
17335  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
17336  if (__pyx_t_2) {
17337 
17338  /* "View.MemoryView":891
17339  *
17340  * if suboffset >= 0:
17341  * if not is_slice: # <<<<<<<<<<<<<<
17342  * if new_ndim == 0:
17343  * dst.data = (<char **> dst.data)[0] + suboffset
17344  */
17345  __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
17346  if (__pyx_t_2) {
17347 
17348  /* "View.MemoryView":892
17349  * if suboffset >= 0:
17350  * if not is_slice:
17351  * if new_ndim == 0: # <<<<<<<<<<<<<<
17352  * dst.data = (<char **> dst.data)[0] + suboffset
17353  * else:
17354  */
17355  __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
17356  if (__pyx_t_2) {
17357 
17358  /* "View.MemoryView":893
17359  * if not is_slice:
17360  * if new_ndim == 0:
17361  * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
17362  * else:
17363  * _err_dim(IndexError, "All dimensions preceding dimension %d "
17364  */
17365  __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
17366 
17367  /* "View.MemoryView":892
17368  * if suboffset >= 0:
17369  * if not is_slice:
17370  * if new_ndim == 0: # <<<<<<<<<<<<<<
17371  * dst.data = (<char **> dst.data)[0] + suboffset
17372  * else:
17373  */
17374  goto __pyx_L26;
17375  }
17376 
17377  /* "View.MemoryView":895
17378  * dst.data = (<char **> dst.data)[0] + suboffset
17379  * else:
17380  * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
17381  * "must be indexed and not sliced", dim)
17382  * else:
17383  */
17384  /*else*/ {
17385 
17386  /* "View.MemoryView":896
17387  * else:
17388  * _err_dim(IndexError, "All dimensions preceding dimension %d "
17389  * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
17390  * else:
17391  * suboffset_dim[0] = new_ndim
17392  */
17393  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 895, __pyx_L1_error)
17394  }
17395  __pyx_L26:;
17396 
17397  /* "View.MemoryView":891
17398  *
17399  * if suboffset >= 0:
17400  * if not is_slice: # <<<<<<<<<<<<<<
17401  * if new_ndim == 0:
17402  * dst.data = (<char **> dst.data)[0] + suboffset
17403  */
17404  goto __pyx_L25;
17405  }
17406 
17407  /* "View.MemoryView":898
17408  * "must be indexed and not sliced", dim)
17409  * else:
17410  * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
17411  *
17412  * return 0
17413  */
17414  /*else*/ {
17415  (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
17416  }
17417  __pyx_L25:;
17418 
17419  /* "View.MemoryView":890
17420  * dst.suboffsets[suboffset_dim[0]] += start * stride
17421  *
17422  * if suboffset >= 0: # <<<<<<<<<<<<<<
17423  * if not is_slice:
17424  * if new_ndim == 0:
17425  */
17426  }
17427 
17428  /* "View.MemoryView":900
17429  * suboffset_dim[0] = new_ndim
17430  *
17431  * return 0 # <<<<<<<<<<<<<<
17432  *
17433  *
17434  */
17435  __pyx_r = 0;
17436  goto __pyx_L0;
17437 
17438  /* "View.MemoryView":803
17439  *
17440  * @cname('__pyx_memoryview_slice_memviewslice')
17441  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
17442  * __Pyx_memviewslice *dst,
17443  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
17444  */
17445 
17446  /* function exit code */
17447  __pyx_L1_error:;
17448  {
17449  #ifdef WITH_THREAD
17450  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17451  #endif
17452  __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17453  #ifdef WITH_THREAD
17454  __Pyx_PyGILState_Release(__pyx_gilstate_save);
17455  #endif
17456  }
17457  __pyx_r = -1;
17458  __pyx_L0:;
17459  __Pyx_TraceReturn(Py_None, 1);
17460  return __pyx_r;
17461 }
17462 
17463 /* "View.MemoryView":906
17464  *
17465  * @cname('__pyx_pybuffer_index')
17466  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
17467  * Py_ssize_t dim) except NULL:
17468  * cdef Py_ssize_t shape, stride, suboffset = -1
17469  */
17470 
17471 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
17472  Py_ssize_t __pyx_v_shape;
17473  Py_ssize_t __pyx_v_stride;
17474  Py_ssize_t __pyx_v_suboffset;
17475  Py_ssize_t __pyx_v_itemsize;
17476  char *__pyx_v_resultp;
17477  char *__pyx_r;
17478  __Pyx_TraceDeclarations
17479  __Pyx_RefNannyDeclarations
17480  Py_ssize_t __pyx_t_1;
17481  int __pyx_t_2;
17482  PyObject *__pyx_t_3 = NULL;
17483  PyObject *__pyx_t_4 = NULL;
17484  __Pyx_RefNannySetupContext("pybuffer_index", 0);
17485  __Pyx_TraceCall("pybuffer_index", __pyx_f[1], 906, 0, __PYX_ERR(1, 906, __pyx_L1_error));
17486 
17487  /* "View.MemoryView":908
17488  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
17489  * Py_ssize_t dim) except NULL:
17490  * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
17491  * cdef Py_ssize_t itemsize = view.itemsize
17492  * cdef char *resultp
17493  */
17494  __pyx_v_suboffset = -1L;
17495 
17496  /* "View.MemoryView":909
17497  * Py_ssize_t dim) except NULL:
17498  * cdef Py_ssize_t shape, stride, suboffset = -1
17499  * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
17500  * cdef char *resultp
17501  *
17502  */
17503  __pyx_t_1 = __pyx_v_view->itemsize;
17504  __pyx_v_itemsize = __pyx_t_1;
17505 
17506  /* "View.MemoryView":912
17507  * cdef char *resultp
17508  *
17509  * if view.ndim == 0: # <<<<<<<<<<<<<<
17510  * shape = view.len / itemsize
17511  * stride = itemsize
17512  */
17513  __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
17514  if (__pyx_t_2) {
17515 
17516  /* "View.MemoryView":913
17517  *
17518  * if view.ndim == 0:
17519  * shape = view.len / itemsize # <<<<<<<<<<<<<<
17520  * stride = itemsize
17521  * else:
17522  */
17523  if (unlikely(__pyx_v_itemsize == 0)) {
17524  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
17525  __PYX_ERR(1, 913, __pyx_L1_error)
17526  }
17527  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
17528  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
17529  __PYX_ERR(1, 913, __pyx_L1_error)
17530  }
17531  __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
17532 
17533  /* "View.MemoryView":914
17534  * if view.ndim == 0:
17535  * shape = view.len / itemsize
17536  * stride = itemsize # <<<<<<<<<<<<<<
17537  * else:
17538  * shape = view.shape[dim]
17539  */
17540  __pyx_v_stride = __pyx_v_itemsize;
17541 
17542  /* "View.MemoryView":912
17543  * cdef char *resultp
17544  *
17545  * if view.ndim == 0: # <<<<<<<<<<<<<<
17546  * shape = view.len / itemsize
17547  * stride = itemsize
17548  */
17549  goto __pyx_L3;
17550  }
17551 
17552  /* "View.MemoryView":916
17553  * stride = itemsize
17554  * else:
17555  * shape = view.shape[dim] # <<<<<<<<<<<<<<
17556  * stride = view.strides[dim]
17557  * if view.suboffsets != NULL:
17558  */
17559  /*else*/ {
17560  __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
17561 
17562  /* "View.MemoryView":917
17563  * else:
17564  * shape = view.shape[dim]
17565  * stride = view.strides[dim] # <<<<<<<<<<<<<<
17566  * if view.suboffsets != NULL:
17567  * suboffset = view.suboffsets[dim]
17568  */
17569  __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
17570 
17571  /* "View.MemoryView":918
17572  * shape = view.shape[dim]
17573  * stride = view.strides[dim]
17574  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
17575  * suboffset = view.suboffsets[dim]
17576  *
17577  */
17578  __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
17579  if (__pyx_t_2) {
17580 
17581  /* "View.MemoryView":919
17582  * stride = view.strides[dim]
17583  * if view.suboffsets != NULL:
17584  * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
17585  *
17586  * if index < 0:
17587  */
17588  __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
17589 
17590  /* "View.MemoryView":918
17591  * shape = view.shape[dim]
17592  * stride = view.strides[dim]
17593  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
17594  * suboffset = view.suboffsets[dim]
17595  *
17596  */
17597  }
17598  }
17599  __pyx_L3:;
17600 
17601  /* "View.MemoryView":921
17602  * suboffset = view.suboffsets[dim]
17603  *
17604  * if index < 0: # <<<<<<<<<<<<<<
17605  * index += view.shape[dim]
17606  * if index < 0:
17607  */
17608  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
17609  if (__pyx_t_2) {
17610 
17611  /* "View.MemoryView":922
17612  *
17613  * if index < 0:
17614  * index += view.shape[dim] # <<<<<<<<<<<<<<
17615  * if index < 0:
17616  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17617  */
17618  __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
17619 
17620  /* "View.MemoryView":923
17621  * if index < 0:
17622  * index += view.shape[dim]
17623  * if index < 0: # <<<<<<<<<<<<<<
17624  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17625  *
17626  */
17627  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
17628  if (unlikely(__pyx_t_2)) {
17629 
17630  /* "View.MemoryView":924
17631  * index += view.shape[dim]
17632  * if index < 0:
17633  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
17634  *
17635  * if index >= shape:
17636  */
17637  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 924, __pyx_L1_error)
17638  __Pyx_GOTREF(__pyx_t_3);
17639  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 924, __pyx_L1_error)
17640  __Pyx_GOTREF(__pyx_t_4);
17641  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17642  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 924, __pyx_L1_error)
17643  __Pyx_GOTREF(__pyx_t_3);
17644  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17645  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17646  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17647  __PYX_ERR(1, 924, __pyx_L1_error)
17648 
17649  /* "View.MemoryView":923
17650  * if index < 0:
17651  * index += view.shape[dim]
17652  * if index < 0: # <<<<<<<<<<<<<<
17653  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17654  *
17655  */
17656  }
17657 
17658  /* "View.MemoryView":921
17659  * suboffset = view.suboffsets[dim]
17660  *
17661  * if index < 0: # <<<<<<<<<<<<<<
17662  * index += view.shape[dim]
17663  * if index < 0:
17664  */
17665  }
17666 
17667  /* "View.MemoryView":926
17668  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17669  *
17670  * if index >= shape: # <<<<<<<<<<<<<<
17671  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17672  *
17673  */
17674  __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
17675  if (unlikely(__pyx_t_2)) {
17676 
17677  /* "View.MemoryView":927
17678  *
17679  * if index >= shape:
17680  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
17681  *
17682  * resultp = bufp + index * stride
17683  */
17684  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 927, __pyx_L1_error)
17685  __Pyx_GOTREF(__pyx_t_3);
17686  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 927, __pyx_L1_error)
17687  __Pyx_GOTREF(__pyx_t_4);
17688  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17689  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 927, __pyx_L1_error)
17690  __Pyx_GOTREF(__pyx_t_3);
17691  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17692  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17693  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17694  __PYX_ERR(1, 927, __pyx_L1_error)
17695 
17696  /* "View.MemoryView":926
17697  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17698  *
17699  * if index >= shape: # <<<<<<<<<<<<<<
17700  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17701  *
17702  */
17703  }
17704 
17705  /* "View.MemoryView":929
17706  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17707  *
17708  * resultp = bufp + index * stride # <<<<<<<<<<<<<<
17709  * if suboffset >= 0:
17710  * resultp = (<char **> resultp)[0] + suboffset
17711  */
17712  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
17713 
17714  /* "View.MemoryView":930
17715  *
17716  * resultp = bufp + index * stride
17717  * if suboffset >= 0: # <<<<<<<<<<<<<<
17718  * resultp = (<char **> resultp)[0] + suboffset
17719  *
17720  */
17721  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
17722  if (__pyx_t_2) {
17723 
17724  /* "View.MemoryView":931
17725  * resultp = bufp + index * stride
17726  * if suboffset >= 0:
17727  * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
17728  *
17729  * return resultp
17730  */
17731  __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
17732 
17733  /* "View.MemoryView":930
17734  *
17735  * resultp = bufp + index * stride
17736  * if suboffset >= 0: # <<<<<<<<<<<<<<
17737  * resultp = (<char **> resultp)[0] + suboffset
17738  *
17739  */
17740  }
17741 
17742  /* "View.MemoryView":933
17743  * resultp = (<char **> resultp)[0] + suboffset
17744  *
17745  * return resultp # <<<<<<<<<<<<<<
17746  *
17747  *
17748  */
17749  __pyx_r = __pyx_v_resultp;
17750  goto __pyx_L0;
17751 
17752  /* "View.MemoryView":906
17753  *
17754  * @cname('__pyx_pybuffer_index')
17755  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
17756  * Py_ssize_t dim) except NULL:
17757  * cdef Py_ssize_t shape, stride, suboffset = -1
17758  */
17759 
17760  /* function exit code */
17761  __pyx_L1_error:;
17762  __Pyx_XDECREF(__pyx_t_3);
17763  __Pyx_XDECREF(__pyx_t_4);
17764  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
17765  __pyx_r = NULL;
17766  __pyx_L0:;
17767  __Pyx_TraceReturn(Py_None, 0);
17768  __Pyx_RefNannyFinishContext();
17769  return __pyx_r;
17770 }
17771 
17772 /* "View.MemoryView":939
17773  *
17774  * @cname('__pyx_memslice_transpose')
17775  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
17776  * cdef int ndim = memslice.memview.view.ndim
17777  *
17778  */
17779 
17780 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
17781  int __pyx_v_ndim;
17782  Py_ssize_t *__pyx_v_shape;
17783  Py_ssize_t *__pyx_v_strides;
17784  int __pyx_v_i;
17785  int __pyx_v_j;
17786  int __pyx_r;
17787  __Pyx_TraceDeclarations
17788  int __pyx_t_1;
17789  Py_ssize_t *__pyx_t_2;
17790  long __pyx_t_3;
17791  long __pyx_t_4;
17792  Py_ssize_t __pyx_t_5;
17793  Py_ssize_t __pyx_t_6;
17794  int __pyx_t_7;
17795  int __pyx_t_8;
17796  int __pyx_t_9;
17797  __Pyx_TraceCall("transpose_memslice", __pyx_f[1], 939, 1, __PYX_ERR(1, 939, __pyx_L1_error));
17798 
17799  /* "View.MemoryView":940
17800  * @cname('__pyx_memslice_transpose')
17801  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
17802  * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
17803  *
17804  * cdef Py_ssize_t *shape = memslice.shape
17805  */
17806  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
17807  __pyx_v_ndim = __pyx_t_1;
17808 
17809  /* "View.MemoryView":942
17810  * cdef int ndim = memslice.memview.view.ndim
17811  *
17812  * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
17813  * cdef Py_ssize_t *strides = memslice.strides
17814  *
17815  */
17816  __pyx_t_2 = __pyx_v_memslice->shape;
17817  __pyx_v_shape = __pyx_t_2;
17818 
17819  /* "View.MemoryView":943
17820  *
17821  * cdef Py_ssize_t *shape = memslice.shape
17822  * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
17823  *
17824  *
17825  */
17826  __pyx_t_2 = __pyx_v_memslice->strides;
17827  __pyx_v_strides = __pyx_t_2;
17828 
17829  /* "View.MemoryView":947
17830  *
17831  * cdef int i, j
17832  * for i in range(ndim / 2): # <<<<<<<<<<<<<<
17833  * j = ndim - 1 - i
17834  * strides[i], strides[j] = strides[j], strides[i]
17835  */
17836  __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
17837  __pyx_t_4 = __pyx_t_3;
17838  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
17839  __pyx_v_i = __pyx_t_1;
17840 
17841  /* "View.MemoryView":948
17842  * cdef int i, j
17843  * for i in range(ndim / 2):
17844  * j = ndim - 1 - i # <<<<<<<<<<<<<<
17845  * strides[i], strides[j] = strides[j], strides[i]
17846  * shape[i], shape[j] = shape[j], shape[i]
17847  */
17848  __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
17849 
17850  /* "View.MemoryView":949
17851  * for i in range(ndim / 2):
17852  * j = ndim - 1 - i
17853  * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
17854  * shape[i], shape[j] = shape[j], shape[i]
17855  *
17856  */
17857  __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
17858  __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
17859  (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
17860  (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
17861 
17862  /* "View.MemoryView":950
17863  * j = ndim - 1 - i
17864  * strides[i], strides[j] = strides[j], strides[i]
17865  * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
17866  *
17867  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
17868  */
17869  __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
17870  __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
17871  (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
17872  (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
17873 
17874  /* "View.MemoryView":952
17875  * shape[i], shape[j] = shape[j], shape[i]
17876  *
17877  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
17878  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17879  *
17880  */
17881  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
17882  if (!__pyx_t_8) {
17883  } else {
17884  __pyx_t_7 = __pyx_t_8;
17885  goto __pyx_L6_bool_binop_done;
17886  }
17887  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
17888  __pyx_t_7 = __pyx_t_8;
17889  __pyx_L6_bool_binop_done:;
17890  if (__pyx_t_7) {
17891 
17892  /* "View.MemoryView":953
17893  *
17894  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
17895  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
17896  *
17897  * return 1
17898  */
17899  __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 953, __pyx_L1_error)
17900 
17901  /* "View.MemoryView":952
17902  * shape[i], shape[j] = shape[j], shape[i]
17903  *
17904  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
17905  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17906  *
17907  */
17908  }
17909  }
17910 
17911  /* "View.MemoryView":955
17912  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17913  *
17914  * return 1 # <<<<<<<<<<<<<<
17915  *
17916  *
17917  */
17918  __pyx_r = 1;
17919  goto __pyx_L0;
17920 
17921  /* "View.MemoryView":939
17922  *
17923  * @cname('__pyx_memslice_transpose')
17924  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
17925  * cdef int ndim = memslice.memview.view.ndim
17926  *
17927  */
17928 
17929  /* function exit code */
17930  __pyx_L1_error:;
17931  {
17932  #ifdef WITH_THREAD
17933  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17934  #endif
17935  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17936  #ifdef WITH_THREAD
17937  __Pyx_PyGILState_Release(__pyx_gilstate_save);
17938  #endif
17939  }
17940  __pyx_r = 0;
17941  __pyx_L0:;
17942  __Pyx_TraceReturn(Py_None, 1);
17943  return __pyx_r;
17944 }
17945 
17946 /* "View.MemoryView":972
17947  * cdef int (*to_dtype_func)(char *, object) except 0
17948  *
17949  * def __dealloc__(self): # <<<<<<<<<<<<<<
17950  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17951  *
17952  */
17953 
17954 /* Python wrapper */
17955 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
17956 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
17957  __Pyx_RefNannyDeclarations
17958  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
17959  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17960 
17961  /* function exit code */
17962  __Pyx_RefNannyFinishContext();
17963 }
17964 
17965 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17966  __Pyx_TraceDeclarations
17967  __Pyx_RefNannyDeclarations
17968  __Pyx_RefNannySetupContext("__dealloc__", 0);
17969  __Pyx_TraceCall("__dealloc__", __pyx_f[1], 972, 0, __PYX_ERR(1, 972, __pyx_L1_error));
17970 
17971  /* "View.MemoryView":973
17972  *
17973  * def __dealloc__(self):
17974  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
17975  *
17976  * cdef convert_item_to_object(self, char *itemp):
17977  */
17978  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
17979 
17980  /* "View.MemoryView":972
17981  * cdef int (*to_dtype_func)(char *, object) except 0
17982  *
17983  * def __dealloc__(self): # <<<<<<<<<<<<<<
17984  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17985  *
17986  */
17987 
17988  /* function exit code */
17989  goto __pyx_L0;
17990  __pyx_L1_error:;
17991  __Pyx_WriteUnraisable("View.MemoryView._memoryviewslice.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
17992  __pyx_L0:;
17993  __Pyx_TraceReturn(Py_None, 0);
17994  __Pyx_RefNannyFinishContext();
17995 }
17996 
17997 /* "View.MemoryView":975
17998  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17999  *
18000  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
18001  * if self.to_object_func != NULL:
18002  * return self.to_object_func(itemp)
18003  */
18004 
18005 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
18006  PyObject *__pyx_r = NULL;
18007  __Pyx_TraceDeclarations
18008  __Pyx_RefNannyDeclarations
18009  int __pyx_t_1;
18010  PyObject *__pyx_t_2 = NULL;
18011  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
18012  __Pyx_TraceCall("convert_item_to_object", __pyx_f[1], 975, 0, __PYX_ERR(1, 975, __pyx_L1_error));
18013 
18014  /* "View.MemoryView":976
18015  *
18016  * cdef convert_item_to_object(self, char *itemp):
18017  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
18018  * return self.to_object_func(itemp)
18019  * else:
18020  */
18021  __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
18022  if (__pyx_t_1) {
18023 
18024  /* "View.MemoryView":977
18025  * cdef convert_item_to_object(self, char *itemp):
18026  * if self.to_object_func != NULL:
18027  * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
18028  * else:
18029  * return memoryview.convert_item_to_object(self, itemp)
18030  */
18031  __Pyx_XDECREF(__pyx_r);
18032  __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 977, __pyx_L1_error)
18033  __Pyx_GOTREF(__pyx_t_2);
18034  __pyx_r = __pyx_t_2;
18035  __pyx_t_2 = 0;
18036  goto __pyx_L0;
18037 
18038  /* "View.MemoryView":976
18039  *
18040  * cdef convert_item_to_object(self, char *itemp):
18041  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
18042  * return self.to_object_func(itemp)
18043  * else:
18044  */
18045  }
18046 
18047  /* "View.MemoryView":979
18048  * return self.to_object_func(itemp)
18049  * else:
18050  * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
18051  *
18052  * cdef assign_item_from_object(self, char *itemp, object value):
18053  */
18054  /*else*/ {
18055  __Pyx_XDECREF(__pyx_r);
18056  __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 979, __pyx_L1_error)
18057  __Pyx_GOTREF(__pyx_t_2);
18058  __pyx_r = __pyx_t_2;
18059  __pyx_t_2 = 0;
18060  goto __pyx_L0;
18061  }
18062 
18063  /* "View.MemoryView":975
18064  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
18065  *
18066  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
18067  * if self.to_object_func != NULL:
18068  * return self.to_object_func(itemp)
18069  */
18070 
18071  /* function exit code */
18072  __pyx_L1_error:;
18073  __Pyx_XDECREF(__pyx_t_2);
18074  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
18075  __pyx_r = 0;
18076  __pyx_L0:;
18077  __Pyx_XGIVEREF(__pyx_r);
18078  __Pyx_TraceReturn(__pyx_r, 0);
18079  __Pyx_RefNannyFinishContext();
18080  return __pyx_r;
18081 }
18082 
18083 /* "View.MemoryView":981
18084  * return memoryview.convert_item_to_object(self, itemp)
18085  *
18086  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
18087  * if self.to_dtype_func != NULL:
18088  * self.to_dtype_func(itemp, value)
18089  */
18090 
18091 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
18092  PyObject *__pyx_r = NULL;
18093  __Pyx_TraceDeclarations
18094  __Pyx_RefNannyDeclarations
18095  int __pyx_t_1;
18096  int __pyx_t_2;
18097  PyObject *__pyx_t_3 = NULL;
18098  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
18099  __Pyx_TraceCall("assign_item_from_object", __pyx_f[1], 981, 0, __PYX_ERR(1, 981, __pyx_L1_error));
18100 
18101  /* "View.MemoryView":982
18102  *
18103  * cdef assign_item_from_object(self, char *itemp, object value):
18104  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
18105  * self.to_dtype_func(itemp, value)
18106  * else:
18107  */
18108  __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
18109  if (__pyx_t_1) {
18110 
18111  /* "View.MemoryView":983
18112  * cdef assign_item_from_object(self, char *itemp, object value):
18113  * if self.to_dtype_func != NULL:
18114  * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
18115  * else:
18116  * memoryview.assign_item_from_object(self, itemp, value)
18117  */
18118  __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 983, __pyx_L1_error)
18119 
18120  /* "View.MemoryView":982
18121  *
18122  * cdef assign_item_from_object(self, char *itemp, object value):
18123  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
18124  * self.to_dtype_func(itemp, value)
18125  * else:
18126  */
18127  goto __pyx_L3;
18128  }
18129 
18130  /* "View.MemoryView":985
18131  * self.to_dtype_func(itemp, value)
18132  * else:
18133  * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
18134  *
18135  * @property
18136  */
18137  /*else*/ {
18138  __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 985, __pyx_L1_error)
18139  __Pyx_GOTREF(__pyx_t_3);
18140  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18141  }
18142  __pyx_L3:;
18143 
18144  /* "View.MemoryView":981
18145  * return memoryview.convert_item_to_object(self, itemp)
18146  *
18147  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
18148  * if self.to_dtype_func != NULL:
18149  * self.to_dtype_func(itemp, value)
18150  */
18151 
18152  /* function exit code */
18153  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18154  goto __pyx_L0;
18155  __pyx_L1_error:;
18156  __Pyx_XDECREF(__pyx_t_3);
18157  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
18158  __pyx_r = 0;
18159  __pyx_L0:;
18160  __Pyx_XGIVEREF(__pyx_r);
18161  __Pyx_TraceReturn(__pyx_r, 0);
18162  __Pyx_RefNannyFinishContext();
18163  return __pyx_r;
18164 }
18165 
18166 /* "View.MemoryView":988
18167  *
18168  * @property
18169  * def base(self): # <<<<<<<<<<<<<<
18170  * return self.from_object
18171  *
18172  */
18173 
18174 /* Python wrapper */
18175 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
18176 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
18177  PyObject *__pyx_r = 0;
18178  __Pyx_RefNannyDeclarations
18179  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
18180  __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
18181 
18182  /* function exit code */
18183  __Pyx_RefNannyFinishContext();
18184  return __pyx_r;
18185 }
18186 
18187 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
18188  PyObject *__pyx_r = NULL;
18189  __Pyx_TraceDeclarations
18190  __Pyx_RefNannyDeclarations
18191  __Pyx_RefNannySetupContext("__get__", 0);
18192  __Pyx_TraceCall("__get__", __pyx_f[1], 988, 0, __PYX_ERR(1, 988, __pyx_L1_error));
18193 
18194  /* "View.MemoryView":989
18195  * @property
18196  * def base(self):
18197  * return self.from_object # <<<<<<<<<<<<<<
18198  *
18199  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
18200  */
18201  __Pyx_XDECREF(__pyx_r);
18202  __Pyx_INCREF(__pyx_v_self->from_object);
18203  __pyx_r = __pyx_v_self->from_object;
18204  goto __pyx_L0;
18205 
18206  /* "View.MemoryView":988
18207  *
18208  * @property
18209  * def base(self): # <<<<<<<<<<<<<<
18210  * return self.from_object
18211  *
18212  */
18213 
18214  /* function exit code */
18215  __pyx_L1_error:;
18216  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18217  __pyx_r = NULL;
18218  __pyx_L0:;
18219  __Pyx_XGIVEREF(__pyx_r);
18220  __Pyx_TraceReturn(__pyx_r, 0);
18221  __Pyx_RefNannyFinishContext();
18222  return __pyx_r;
18223 }
18224 
18225 /* "(tree fragment)":1
18226  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
18227  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18228  * def __setstate_cython__(self, __pyx_state):
18229  */
18230 
18231 /* Python wrapper */
18232 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
18233 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0};
18234 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
18235  PyObject *__pyx_r = 0;
18236  __Pyx_RefNannyDeclarations
18237  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
18238  __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
18239 
18240  /* function exit code */
18241  __Pyx_RefNannyFinishContext();
18242  return __pyx_r;
18243 }
18244 
18245 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
18246  PyObject *__pyx_r = NULL;
18247  __Pyx_TraceDeclarations
18248  __Pyx_RefNannyDeclarations
18249  PyObject *__pyx_t_1 = NULL;
18250  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
18251  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
18252 
18253  /* "(tree fragment)":2
18254  * def __reduce_cython__(self):
18255  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
18256  * def __setstate_cython__(self, __pyx_state):
18257  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18258  */
18259  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
18260  __Pyx_GOTREF(__pyx_t_1);
18261  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18262  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18263  __PYX_ERR(1, 2, __pyx_L1_error)
18264 
18265  /* "(tree fragment)":1
18266  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
18267  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18268  * def __setstate_cython__(self, __pyx_state):
18269  */
18270 
18271  /* function exit code */
18272  __pyx_L1_error:;
18273  __Pyx_XDECREF(__pyx_t_1);
18274  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18275  __pyx_r = NULL;
18276  __Pyx_XGIVEREF(__pyx_r);
18277  __Pyx_TraceReturn(__pyx_r, 0);
18278  __Pyx_RefNannyFinishContext();
18279  return __pyx_r;
18280 }
18281 
18282 /* "(tree fragment)":3
18283  * def __reduce_cython__(self):
18284  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18285  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
18286  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18287  */
18288 
18289 /* Python wrapper */
18290 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
18291 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0};
18292 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
18293  PyObject *__pyx_r = 0;
18294  __Pyx_RefNannyDeclarations
18295  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
18296  __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
18297 
18298  /* function exit code */
18299  __Pyx_RefNannyFinishContext();
18300  return __pyx_r;
18301 }
18302 
18303 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
18304  PyObject *__pyx_r = NULL;
18305  __Pyx_TraceDeclarations
18306  __Pyx_RefNannyDeclarations
18307  PyObject *__pyx_t_1 = NULL;
18308  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
18309  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
18310 
18311  /* "(tree fragment)":4
18312  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18313  * def __setstate_cython__(self, __pyx_state):
18314  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
18315  */
18316  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
18317  __Pyx_GOTREF(__pyx_t_1);
18318  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18319  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18320  __PYX_ERR(1, 4, __pyx_L1_error)
18321 
18322  /* "(tree fragment)":3
18323  * def __reduce_cython__(self):
18324  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18325  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
18326  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18327  */
18328 
18329  /* function exit code */
18330  __pyx_L1_error:;
18331  __Pyx_XDECREF(__pyx_t_1);
18332  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18333  __pyx_r = NULL;
18334  __Pyx_XGIVEREF(__pyx_r);
18335  __Pyx_TraceReturn(__pyx_r, 0);
18336  __Pyx_RefNannyFinishContext();
18337  return __pyx_r;
18338 }
18339 
18340 /* "View.MemoryView":995
18341  *
18342  * @cname('__pyx_memoryview_fromslice')
18343  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
18344  * int ndim,
18345  * object (*to_object_func)(char *),
18346  */
18347 
18348 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
18349  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
18350  Py_ssize_t __pyx_v_suboffset;
18351  PyObject *__pyx_v_length = NULL;
18352  PyObject *__pyx_r = NULL;
18353  __Pyx_TraceDeclarations
18354  __Pyx_RefNannyDeclarations
18355  int __pyx_t_1;
18356  PyObject *__pyx_t_2 = NULL;
18357  PyObject *__pyx_t_3 = NULL;
18358  __Pyx_TypeInfo *__pyx_t_4;
18359  Py_buffer __pyx_t_5;
18360  Py_ssize_t *__pyx_t_6;
18361  Py_ssize_t *__pyx_t_7;
18362  Py_ssize_t *__pyx_t_8;
18363  Py_ssize_t __pyx_t_9;
18364  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
18365  __Pyx_TraceCall("memoryview_fromslice", __pyx_f[1], 995, 0, __PYX_ERR(1, 995, __pyx_L1_error));
18366 
18367  /* "View.MemoryView":1003
18368  * cdef _memoryviewslice result
18369  *
18370  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
18371  * return None
18372  *
18373  */
18374  __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
18375  if (__pyx_t_1) {
18376 
18377  /* "View.MemoryView":1004
18378  *
18379  * if <PyObject *> memviewslice.memview == Py_None:
18380  * return None # <<<<<<<<<<<<<<
18381  *
18382  *
18383  */
18384  __Pyx_XDECREF(__pyx_r);
18385  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18386  goto __pyx_L0;
18387 
18388  /* "View.MemoryView":1003
18389  * cdef _memoryviewslice result
18390  *
18391  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
18392  * return None
18393  *
18394  */
18395  }
18396 
18397  /* "View.MemoryView":1009
18398  *
18399  *
18400  * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
18401  *
18402  * result.from_slice = memviewslice
18403  */
18404  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1009, __pyx_L1_error)
18405  __Pyx_GOTREF(__pyx_t_2);
18406  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1009, __pyx_L1_error)
18407  __Pyx_GOTREF(__pyx_t_3);
18408  __Pyx_INCREF(Py_None);
18409  __Pyx_GIVEREF(Py_None);
18410  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
18411  __Pyx_INCREF(__pyx_int_0);
18412  __Pyx_GIVEREF(__pyx_int_0);
18413  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
18414  __Pyx_GIVEREF(__pyx_t_2);
18415  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
18416  __pyx_t_2 = 0;
18417  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1009, __pyx_L1_error)
18418  __Pyx_GOTREF(__pyx_t_2);
18419  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18420  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
18421  __pyx_t_2 = 0;
18422 
18423  /* "View.MemoryView":1011
18424  * result = _memoryviewslice(None, 0, dtype_is_object)
18425  *
18426  * result.from_slice = memviewslice # <<<<<<<<<<<<<<
18427  * __PYX_INC_MEMVIEW(&memviewslice, 1)
18428  *
18429  */
18430  __pyx_v_result->from_slice = __pyx_v_memviewslice;
18431 
18432  /* "View.MemoryView":1012
18433  *
18434  * result.from_slice = memviewslice
18435  * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
18436  *
18437  * result.from_object = (<memoryview> memviewslice.memview).base
18438  */
18439  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
18440 
18441  /* "View.MemoryView":1014
18442  * __PYX_INC_MEMVIEW(&memviewslice, 1)
18443  *
18444  * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
18445  * result.typeinfo = memviewslice.memview.typeinfo
18446  *
18447  */
18448  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1014, __pyx_L1_error)
18449  __Pyx_GOTREF(__pyx_t_2);
18450  __Pyx_GIVEREF(__pyx_t_2);
18451  __Pyx_GOTREF(__pyx_v_result->from_object);
18452  __Pyx_DECREF(__pyx_v_result->from_object);
18453  __pyx_v_result->from_object = __pyx_t_2;
18454  __pyx_t_2 = 0;
18455 
18456  /* "View.MemoryView":1015
18457  *
18458  * result.from_object = (<memoryview> memviewslice.memview).base
18459  * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
18460  *
18461  * result.view = memviewslice.memview.view
18462  */
18463  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
18464  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
18465 
18466  /* "View.MemoryView":1017
18467  * result.typeinfo = memviewslice.memview.typeinfo
18468  *
18469  * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
18470  * result.view.buf = <void *> memviewslice.data
18471  * result.view.ndim = ndim
18472  */
18473  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
18474  __pyx_v_result->__pyx_base.view = __pyx_t_5;
18475 
18476  /* "View.MemoryView":1018
18477  *
18478  * result.view = memviewslice.memview.view
18479  * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
18480  * result.view.ndim = ndim
18481  * (<__pyx_buffer *> &result.view).obj = Py_None
18482  */
18483  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
18484 
18485  /* "View.MemoryView":1019
18486  * result.view = memviewslice.memview.view
18487  * result.view.buf = <void *> memviewslice.data
18488  * result.view.ndim = ndim # <<<<<<<<<<<<<<
18489  * (<__pyx_buffer *> &result.view).obj = Py_None
18490  * Py_INCREF(Py_None)
18491  */
18492  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
18493 
18494  /* "View.MemoryView":1020
18495  * result.view.buf = <void *> memviewslice.data
18496  * result.view.ndim = ndim
18497  * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
18498  * Py_INCREF(Py_None)
18499  *
18500  */
18501  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
18502 
18503  /* "View.MemoryView":1021
18504  * result.view.ndim = ndim
18505  * (<__pyx_buffer *> &result.view).obj = Py_None
18506  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
18507  *
18508  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
18509  */
18510  Py_INCREF(Py_None);
18511 
18512  /* "View.MemoryView":1023
18513  * Py_INCREF(Py_None)
18514  *
18515  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
18516  * result.flags = PyBUF_RECORDS
18517  * else:
18518  */
18519  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
18520  if (__pyx_t_1) {
18521 
18522  /* "View.MemoryView":1024
18523  *
18524  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
18525  * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
18526  * else:
18527  * result.flags = PyBUF_RECORDS_RO
18528  */
18529  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
18530 
18531  /* "View.MemoryView":1023
18532  * Py_INCREF(Py_None)
18533  *
18534  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
18535  * result.flags = PyBUF_RECORDS
18536  * else:
18537  */
18538  goto __pyx_L4;
18539  }
18540 
18541  /* "View.MemoryView":1026
18542  * result.flags = PyBUF_RECORDS
18543  * else:
18544  * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
18545  *
18546  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
18547  */
18548  /*else*/ {
18549  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
18550  }
18551  __pyx_L4:;
18552 
18553  /* "View.MemoryView":1028
18554  * result.flags = PyBUF_RECORDS_RO
18555  *
18556  * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
18557  * result.view.strides = <Py_ssize_t *> result.from_slice.strides
18558  *
18559  */
18560  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
18561 
18562  /* "View.MemoryView":1029
18563  *
18564  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
18565  * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
18566  *
18567  *
18568  */
18569  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
18570 
18571  /* "View.MemoryView":1032
18572  *
18573  *
18574  * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
18575  * for suboffset in result.from_slice.suboffsets[:ndim]:
18576  * if suboffset >= 0:
18577  */
18578  __pyx_v_result->__pyx_base.view.suboffsets = NULL;
18579 
18580  /* "View.MemoryView":1033
18581  *
18582  * result.view.suboffsets = NULL
18583  * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
18584  * if suboffset >= 0:
18585  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18586  */
18587  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
18588  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
18589  __pyx_t_6 = __pyx_t_8;
18590  __pyx_v_suboffset = (__pyx_t_6[0]);
18591 
18592  /* "View.MemoryView":1034
18593  * result.view.suboffsets = NULL
18594  * for suboffset in result.from_slice.suboffsets[:ndim]:
18595  * if suboffset >= 0: # <<<<<<<<<<<<<<
18596  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18597  * break
18598  */
18599  __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
18600  if (__pyx_t_1) {
18601 
18602  /* "View.MemoryView":1035
18603  * for suboffset in result.from_slice.suboffsets[:ndim]:
18604  * if suboffset >= 0:
18605  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
18606  * break
18607  *
18608  */
18609  __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
18610 
18611  /* "View.MemoryView":1036
18612  * if suboffset >= 0:
18613  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18614  * break # <<<<<<<<<<<<<<
18615  *
18616  * result.view.len = result.view.itemsize
18617  */
18618  goto __pyx_L6_break;
18619 
18620  /* "View.MemoryView":1034
18621  * result.view.suboffsets = NULL
18622  * for suboffset in result.from_slice.suboffsets[:ndim]:
18623  * if suboffset >= 0: # <<<<<<<<<<<<<<
18624  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18625  * break
18626  */
18627  }
18628  }
18629  __pyx_L6_break:;
18630 
18631  /* "View.MemoryView":1038
18632  * break
18633  *
18634  * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
18635  * for length in result.view.shape[:ndim]:
18636  * result.view.len *= length
18637  */
18638  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
18639  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
18640 
18641  /* "View.MemoryView":1039
18642  *
18643  * result.view.len = result.view.itemsize
18644  * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
18645  * result.view.len *= length
18646  *
18647  */
18648  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
18649  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
18650  __pyx_t_6 = __pyx_t_8;
18651  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1039, __pyx_L1_error)
18652  __Pyx_GOTREF(__pyx_t_2);
18653  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
18654  __pyx_t_2 = 0;
18655 
18656  /* "View.MemoryView":1040
18657  * result.view.len = result.view.itemsize
18658  * for length in result.view.shape[:ndim]:
18659  * result.view.len *= length # <<<<<<<<<<<<<<
18660  *
18661  * result.to_object_func = to_object_func
18662  */
18663  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1040, __pyx_L1_error)
18664  __Pyx_GOTREF(__pyx_t_2);
18665  __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1040, __pyx_L1_error)
18666  __Pyx_GOTREF(__pyx_t_3);
18667  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18668  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1040, __pyx_L1_error)
18669  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18670  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
18671  }
18672 
18673  /* "View.MemoryView":1042
18674  * result.view.len *= length
18675  *
18676  * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
18677  * result.to_dtype_func = to_dtype_func
18678  *
18679  */
18680  __pyx_v_result->to_object_func = __pyx_v_to_object_func;
18681 
18682  /* "View.MemoryView":1043
18683  *
18684  * result.to_object_func = to_object_func
18685  * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
18686  *
18687  * return result
18688  */
18689  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
18690 
18691  /* "View.MemoryView":1045
18692  * result.to_dtype_func = to_dtype_func
18693  *
18694  * return result # <<<<<<<<<<<<<<
18695  *
18696  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18697  */
18698  __Pyx_XDECREF(__pyx_r);
18699  __Pyx_INCREF(((PyObject *)__pyx_v_result));
18700  __pyx_r = ((PyObject *)__pyx_v_result);
18701  goto __pyx_L0;
18702 
18703  /* "View.MemoryView":995
18704  *
18705  * @cname('__pyx_memoryview_fromslice')
18706  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
18707  * int ndim,
18708  * object (*to_object_func)(char *),
18709  */
18710 
18711  /* function exit code */
18712  __pyx_L1_error:;
18713  __Pyx_XDECREF(__pyx_t_2);
18714  __Pyx_XDECREF(__pyx_t_3);
18715  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18716  __pyx_r = 0;
18717  __pyx_L0:;
18718  __Pyx_XDECREF((PyObject *)__pyx_v_result);
18719  __Pyx_XDECREF(__pyx_v_length);
18720  __Pyx_XGIVEREF(__pyx_r);
18721  __Pyx_TraceReturn(__pyx_r, 0);
18722  __Pyx_RefNannyFinishContext();
18723  return __pyx_r;
18724 }
18725 
18726 /* "View.MemoryView":1048
18727  *
18728  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18729  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
18730  * __Pyx_memviewslice *mslice):
18731  * cdef _memoryviewslice obj
18732  */
18733 
18734 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
18735  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
18736  __Pyx_memviewslice *__pyx_r;
18737  __Pyx_TraceDeclarations
18738  __Pyx_RefNannyDeclarations
18739  int __pyx_t_1;
18740  int __pyx_t_2;
18741  PyObject *__pyx_t_3 = NULL;
18742  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
18743  __Pyx_TraceCall("get_slice_from_memview", __pyx_f[1], 1048, 0, __PYX_ERR(1, 1048, __pyx_L1_error));
18744 
18745  /* "View.MemoryView":1051
18746  * __Pyx_memviewslice *mslice):
18747  * cdef _memoryviewslice obj
18748  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18749  * obj = memview
18750  * return &obj.from_slice
18751  */
18752  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18753  __pyx_t_2 = (__pyx_t_1 != 0);
18754  if (__pyx_t_2) {
18755 
18756  /* "View.MemoryView":1052
18757  * cdef _memoryviewslice obj
18758  * if isinstance(memview, _memoryviewslice):
18759  * obj = memview # <<<<<<<<<<<<<<
18760  * return &obj.from_slice
18761  * else:
18762  */
18763  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1052, __pyx_L1_error)
18764  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
18765  __Pyx_INCREF(__pyx_t_3);
18766  __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
18767  __pyx_t_3 = 0;
18768 
18769  /* "View.MemoryView":1053
18770  * if isinstance(memview, _memoryviewslice):
18771  * obj = memview
18772  * return &obj.from_slice # <<<<<<<<<<<<<<
18773  * else:
18774  * slice_copy(memview, mslice)
18775  */
18776  __pyx_r = (&__pyx_v_obj->from_slice);
18777  goto __pyx_L0;
18778 
18779  /* "View.MemoryView":1051
18780  * __Pyx_memviewslice *mslice):
18781  * cdef _memoryviewslice obj
18782  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18783  * obj = memview
18784  * return &obj.from_slice
18785  */
18786  }
18787 
18788  /* "View.MemoryView":1055
18789  * return &obj.from_slice
18790  * else:
18791  * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
18792  * return mslice
18793  *
18794  */
18795  /*else*/ {
18796  __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
18797 
18798  /* "View.MemoryView":1056
18799  * else:
18800  * slice_copy(memview, mslice)
18801  * return mslice # <<<<<<<<<<<<<<
18802  *
18803  * @cname('__pyx_memoryview_slice_copy')
18804  */
18805  __pyx_r = __pyx_v_mslice;
18806  goto __pyx_L0;
18807  }
18808 
18809  /* "View.MemoryView":1048
18810  *
18811  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18812  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
18813  * __Pyx_memviewslice *mslice):
18814  * cdef _memoryviewslice obj
18815  */
18816 
18817  /* function exit code */
18818  __pyx_L1_error:;
18819  __Pyx_XDECREF(__pyx_t_3);
18820  __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
18821  __pyx_r = 0;
18822  __pyx_L0:;
18823  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
18824  __Pyx_TraceReturn(Py_None, 0);
18825  __Pyx_RefNannyFinishContext();
18826  return __pyx_r;
18827 }
18828 
18829 /* "View.MemoryView":1059
18830  *
18831  * @cname('__pyx_memoryview_slice_copy')
18832  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
18833  * cdef int dim
18834  * cdef (Py_ssize_t*) shape, strides, suboffsets
18835  */
18836 
18837 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
18838  int __pyx_v_dim;
18839  Py_ssize_t *__pyx_v_shape;
18840  Py_ssize_t *__pyx_v_strides;
18841  Py_ssize_t *__pyx_v_suboffsets;
18842  __Pyx_TraceDeclarations
18843  __Pyx_RefNannyDeclarations
18844  Py_ssize_t *__pyx_t_1;
18845  int __pyx_t_2;
18846  int __pyx_t_3;
18847  int __pyx_t_4;
18848  Py_ssize_t __pyx_t_5;
18849  __Pyx_RefNannySetupContext("slice_copy", 0);
18850  __Pyx_TraceCall("slice_copy", __pyx_f[1], 1059, 0, __PYX_ERR(1, 1059, __pyx_L1_error));
18851 
18852  /* "View.MemoryView":1063
18853  * cdef (Py_ssize_t*) shape, strides, suboffsets
18854  *
18855  * shape = memview.view.shape # <<<<<<<<<<<<<<
18856  * strides = memview.view.strides
18857  * suboffsets = memview.view.suboffsets
18858  */
18859  __pyx_t_1 = __pyx_v_memview->view.shape;
18860  __pyx_v_shape = __pyx_t_1;
18861 
18862  /* "View.MemoryView":1064
18863  *
18864  * shape = memview.view.shape
18865  * strides = memview.view.strides # <<<<<<<<<<<<<<
18866  * suboffsets = memview.view.suboffsets
18867  *
18868  */
18869  __pyx_t_1 = __pyx_v_memview->view.strides;
18870  __pyx_v_strides = __pyx_t_1;
18871 
18872  /* "View.MemoryView":1065
18873  * shape = memview.view.shape
18874  * strides = memview.view.strides
18875  * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
18876  *
18877  * dst.memview = <__pyx_memoryview *> memview
18878  */
18879  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
18880  __pyx_v_suboffsets = __pyx_t_1;
18881 
18882  /* "View.MemoryView":1067
18883  * suboffsets = memview.view.suboffsets
18884  *
18885  * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
18886  * dst.data = <char *> memview.view.buf
18887  *
18888  */
18889  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
18890 
18891  /* "View.MemoryView":1068
18892  *
18893  * dst.memview = <__pyx_memoryview *> memview
18894  * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
18895  *
18896  * for dim in range(memview.view.ndim):
18897  */
18898  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
18899 
18900  /* "View.MemoryView":1070
18901  * dst.data = <char *> memview.view.buf
18902  *
18903  * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
18904  * dst.shape[dim] = shape[dim]
18905  * dst.strides[dim] = strides[dim]
18906  */
18907  __pyx_t_2 = __pyx_v_memview->view.ndim;
18908  __pyx_t_3 = __pyx_t_2;
18909  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18910  __pyx_v_dim = __pyx_t_4;
18911 
18912  /* "View.MemoryView":1071
18913  *
18914  * for dim in range(memview.view.ndim):
18915  * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
18916  * dst.strides[dim] = strides[dim]
18917  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
18918  */
18919  (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
18920 
18921  /* "View.MemoryView":1072
18922  * for dim in range(memview.view.ndim):
18923  * dst.shape[dim] = shape[dim]
18924  * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
18925  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
18926  *
18927  */
18928  (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
18929 
18930  /* "View.MemoryView":1073
18931  * dst.shape[dim] = shape[dim]
18932  * dst.strides[dim] = strides[dim]
18933  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
18934  *
18935  * @cname('__pyx_memoryview_copy_object')
18936  */
18937  if ((__pyx_v_suboffsets != 0)) {
18938  __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
18939  } else {
18940  __pyx_t_5 = -1L;
18941  }
18942  (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
18943  }
18944 
18945  /* "View.MemoryView":1059
18946  *
18947  * @cname('__pyx_memoryview_slice_copy')
18948  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
18949  * cdef int dim
18950  * cdef (Py_ssize_t*) shape, strides, suboffsets
18951  */
18952 
18953  /* function exit code */
18954  goto __pyx_L0;
18955  __pyx_L1_error:;
18956  __Pyx_WriteUnraisable("View.MemoryView.slice_copy", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
18957  __pyx_L0:;
18958  __Pyx_TraceReturn(Py_None, 0);
18959  __Pyx_RefNannyFinishContext();
18960 }
18961 
18962 /* "View.MemoryView":1076
18963  *
18964  * @cname('__pyx_memoryview_copy_object')
18965  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
18966  * "Create a new memoryview object"
18967  * cdef __Pyx_memviewslice memviewslice
18968  */
18969 
18970 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
18971  __Pyx_memviewslice __pyx_v_memviewslice;
18972  PyObject *__pyx_r = NULL;
18973  __Pyx_TraceDeclarations
18974  __Pyx_RefNannyDeclarations
18975  PyObject *__pyx_t_1 = NULL;
18976  __Pyx_RefNannySetupContext("memoryview_copy", 0);
18977  __Pyx_TraceCall("memoryview_copy", __pyx_f[1], 1076, 0, __PYX_ERR(1, 1076, __pyx_L1_error));
18978 
18979  /* "View.MemoryView":1079
18980  * "Create a new memoryview object"
18981  * cdef __Pyx_memviewslice memviewslice
18982  * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
18983  * return memoryview_copy_from_slice(memview, &memviewslice)
18984  *
18985  */
18986  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
18987 
18988  /* "View.MemoryView":1080
18989  * cdef __Pyx_memviewslice memviewslice
18990  * slice_copy(memview, &memviewslice)
18991  * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
18992  *
18993  * @cname('__pyx_memoryview_copy_object_from_slice')
18994  */
18995  __Pyx_XDECREF(__pyx_r);
18996  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1080, __pyx_L1_error)
18997  __Pyx_GOTREF(__pyx_t_1);
18998  __pyx_r = __pyx_t_1;
18999  __pyx_t_1 = 0;
19000  goto __pyx_L0;
19001 
19002  /* "View.MemoryView":1076
19003  *
19004  * @cname('__pyx_memoryview_copy_object')
19005  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
19006  * "Create a new memoryview object"
19007  * cdef __Pyx_memviewslice memviewslice
19008  */
19009 
19010  /* function exit code */
19011  __pyx_L1_error:;
19012  __Pyx_XDECREF(__pyx_t_1);
19013  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
19014  __pyx_r = 0;
19015  __pyx_L0:;
19016  __Pyx_XGIVEREF(__pyx_r);
19017  __Pyx_TraceReturn(__pyx_r, 0);
19018  __Pyx_RefNannyFinishContext();
19019  return __pyx_r;
19020 }
19021 
19022 /* "View.MemoryView":1083
19023  *
19024  * @cname('__pyx_memoryview_copy_object_from_slice')
19025  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
19026  * """
19027  * Create a new memoryview object from a given memoryview object and slice.
19028  */
19029 
19030 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
19031  PyObject *(*__pyx_v_to_object_func)(char *);
19032  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
19033  PyObject *__pyx_r = NULL;
19034  __Pyx_TraceDeclarations
19035  __Pyx_RefNannyDeclarations
19036  int __pyx_t_1;
19037  int __pyx_t_2;
19038  PyObject *(*__pyx_t_3)(char *);
19039  int (*__pyx_t_4)(char *, PyObject *);
19040  PyObject *__pyx_t_5 = NULL;
19041  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
19042  __Pyx_TraceCall("memoryview_copy_from_slice", __pyx_f[1], 1083, 0, __PYX_ERR(1, 1083, __pyx_L1_error));
19043 
19044  /* "View.MemoryView":1090
19045  * cdef int (*to_dtype_func)(char *, object) except 0
19046  *
19047  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
19048  * to_object_func = (<_memoryviewslice> memview).to_object_func
19049  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
19050  */
19051  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
19052  __pyx_t_2 = (__pyx_t_1 != 0);
19053  if (__pyx_t_2) {
19054 
19055  /* "View.MemoryView":1091
19056  *
19057  * if isinstance(memview, _memoryviewslice):
19058  * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
19059  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
19060  * else:
19061  */
19062  __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
19063  __pyx_v_to_object_func = __pyx_t_3;
19064 
19065  /* "View.MemoryView":1092
19066  * if isinstance(memview, _memoryviewslice):
19067  * to_object_func = (<_memoryviewslice> memview).to_object_func
19068  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
19069  * else:
19070  * to_object_func = NULL
19071  */
19072  __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
19073  __pyx_v_to_dtype_func = __pyx_t_4;
19074 
19075  /* "View.MemoryView":1090
19076  * cdef int (*to_dtype_func)(char *, object) except 0
19077  *
19078  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
19079  * to_object_func = (<_memoryviewslice> memview).to_object_func
19080  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
19081  */
19082  goto __pyx_L3;
19083  }
19084 
19085  /* "View.MemoryView":1094
19086  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
19087  * else:
19088  * to_object_func = NULL # <<<<<<<<<<<<<<
19089  * to_dtype_func = NULL
19090  *
19091  */
19092  /*else*/ {
19093  __pyx_v_to_object_func = NULL;
19094 
19095  /* "View.MemoryView":1095
19096  * else:
19097  * to_object_func = NULL
19098  * to_dtype_func = NULL # <<<<<<<<<<<<<<
19099  *
19100  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
19101  */
19102  __pyx_v_to_dtype_func = NULL;
19103  }
19104  __pyx_L3:;
19105 
19106  /* "View.MemoryView":1097
19107  * to_dtype_func = NULL
19108  *
19109  * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
19110  * to_object_func, to_dtype_func,
19111  * memview.dtype_is_object)
19112  */
19113  __Pyx_XDECREF(__pyx_r);
19114 
19115  /* "View.MemoryView":1099
19116  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
19117  * to_object_func, to_dtype_func,
19118  * memview.dtype_is_object) # <<<<<<<<<<<<<<
19119  *
19120  *
19121  */
19122  __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1097, __pyx_L1_error)
19123  __Pyx_GOTREF(__pyx_t_5);
19124  __pyx_r = __pyx_t_5;
19125  __pyx_t_5 = 0;
19126  goto __pyx_L0;
19127 
19128  /* "View.MemoryView":1083
19129  *
19130  * @cname('__pyx_memoryview_copy_object_from_slice')
19131  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
19132  * """
19133  * Create a new memoryview object from a given memoryview object and slice.
19134  */
19135 
19136  /* function exit code */
19137  __pyx_L1_error:;
19138  __Pyx_XDECREF(__pyx_t_5);
19139  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
19140  __pyx_r = 0;
19141  __pyx_L0:;
19142  __Pyx_XGIVEREF(__pyx_r);
19143  __Pyx_TraceReturn(__pyx_r, 0);
19144  __Pyx_RefNannyFinishContext();
19145  return __pyx_r;
19146 }
19147 
19148 /* "View.MemoryView":1105
19149  *
19150  *
19151  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
19152  * if arg < 0:
19153  * return -arg
19154  */
19155 
19156 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
19157  Py_ssize_t __pyx_r;
19158  __Pyx_TraceDeclarations
19159  int __pyx_t_1;
19160  __Pyx_TraceCall("abs_py_ssize_t", __pyx_f[1], 1105, 1, __PYX_ERR(1, 1105, __pyx_L1_error));
19161 
19162  /* "View.MemoryView":1106
19163  *
19164  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
19165  * if arg < 0: # <<<<<<<<<<<<<<
19166  * return -arg
19167  * else:
19168  */
19169  __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
19170  if (__pyx_t_1) {
19171 
19172  /* "View.MemoryView":1107
19173  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
19174  * if arg < 0:
19175  * return -arg # <<<<<<<<<<<<<<
19176  * else:
19177  * return arg
19178  */
19179  __pyx_r = (-__pyx_v_arg);
19180  goto __pyx_L0;
19181 
19182  /* "View.MemoryView":1106
19183  *
19184  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
19185  * if arg < 0: # <<<<<<<<<<<<<<
19186  * return -arg
19187  * else:
19188  */
19189  }
19190 
19191  /* "View.MemoryView":1109
19192  * return -arg
19193  * else:
19194  * return arg # <<<<<<<<<<<<<<
19195  *
19196  * @cname('__pyx_get_best_slice_order')
19197  */
19198  /*else*/ {
19199  __pyx_r = __pyx_v_arg;
19200  goto __pyx_L0;
19201  }
19202 
19203  /* "View.MemoryView":1105
19204  *
19205  *
19206  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
19207  * if arg < 0:
19208  * return -arg
19209  */
19210 
19211  /* function exit code */
19212  __pyx_L1_error:;
19213  __Pyx_WriteUnraisable("View.MemoryView.abs_py_ssize_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19214  __pyx_r = 0;
19215  __pyx_L0:;
19216  __Pyx_TraceReturn(Py_None, 1);
19217  return __pyx_r;
19218 }
19219 
19220 /* "View.MemoryView":1112
19221  *
19222  * @cname('__pyx_get_best_slice_order')
19223  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
19224  * """
19225  * Figure out the best memory access order for a given slice.
19226  */
19227 
19228 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
19229  int __pyx_v_i;
19230  Py_ssize_t __pyx_v_c_stride;
19231  Py_ssize_t __pyx_v_f_stride;
19232  char __pyx_r;
19233  __Pyx_TraceDeclarations
19234  int __pyx_t_1;
19235  int __pyx_t_2;
19236  int __pyx_t_3;
19237  int __pyx_t_4;
19238  __Pyx_TraceCall("get_best_order", __pyx_f[1], 1112, 1, __PYX_ERR(1, 1112, __pyx_L1_error));
19239 
19240  /* "View.MemoryView":1117
19241  * """
19242  * cdef int i
19243  * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
19244  * cdef Py_ssize_t f_stride = 0
19245  *
19246  */
19247  __pyx_v_c_stride = 0;
19248 
19249  /* "View.MemoryView":1118
19250  * cdef int i
19251  * cdef Py_ssize_t c_stride = 0
19252  * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
19253  *
19254  * for i in range(ndim - 1, -1, -1):
19255  */
19256  __pyx_v_f_stride = 0;
19257 
19258  /* "View.MemoryView":1120
19259  * cdef Py_ssize_t f_stride = 0
19260  *
19261  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
19262  * if mslice.shape[i] > 1:
19263  * c_stride = mslice.strides[i]
19264  */
19265  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
19266  __pyx_v_i = __pyx_t_1;
19267 
19268  /* "View.MemoryView":1121
19269  *
19270  * for i in range(ndim - 1, -1, -1):
19271  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
19272  * c_stride = mslice.strides[i]
19273  * break
19274  */
19275  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
19276  if (__pyx_t_2) {
19277 
19278  /* "View.MemoryView":1122
19279  * for i in range(ndim - 1, -1, -1):
19280  * if mslice.shape[i] > 1:
19281  * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
19282  * break
19283  *
19284  */
19285  __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
19286 
19287  /* "View.MemoryView":1123
19288  * if mslice.shape[i] > 1:
19289  * c_stride = mslice.strides[i]
19290  * break # <<<<<<<<<<<<<<
19291  *
19292  * for i in range(ndim):
19293  */
19294  goto __pyx_L4_break;
19295 
19296  /* "View.MemoryView":1121
19297  *
19298  * for i in range(ndim - 1, -1, -1):
19299  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
19300  * c_stride = mslice.strides[i]
19301  * break
19302  */
19303  }
19304  }
19305  __pyx_L4_break:;
19306 
19307  /* "View.MemoryView":1125
19308  * break
19309  *
19310  * for i in range(ndim): # <<<<<<<<<<<<<<
19311  * if mslice.shape[i] > 1:
19312  * f_stride = mslice.strides[i]
19313  */
19314  __pyx_t_1 = __pyx_v_ndim;
19315  __pyx_t_3 = __pyx_t_1;
19316  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19317  __pyx_v_i = __pyx_t_4;
19318 
19319  /* "View.MemoryView":1126
19320  *
19321  * for i in range(ndim):
19322  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
19323  * f_stride = mslice.strides[i]
19324  * break
19325  */
19326  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
19327  if (__pyx_t_2) {
19328 
19329  /* "View.MemoryView":1127
19330  * for i in range(ndim):
19331  * if mslice.shape[i] > 1:
19332  * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
19333  * break
19334  *
19335  */
19336  __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
19337 
19338  /* "View.MemoryView":1128
19339  * if mslice.shape[i] > 1:
19340  * f_stride = mslice.strides[i]
19341  * break # <<<<<<<<<<<<<<
19342  *
19343  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
19344  */
19345  goto __pyx_L7_break;
19346 
19347  /* "View.MemoryView":1126
19348  *
19349  * for i in range(ndim):
19350  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
19351  * f_stride = mslice.strides[i]
19352  * break
19353  */
19354  }
19355  }
19356  __pyx_L7_break:;
19357 
19358  /* "View.MemoryView":1130
19359  * break
19360  *
19361  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
19362  * return 'C'
19363  * else:
19364  */
19365  __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
19366  if (__pyx_t_2) {
19367 
19368  /* "View.MemoryView":1131
19369  *
19370  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
19371  * return 'C' # <<<<<<<<<<<<<<
19372  * else:
19373  * return 'F'
19374  */
19375  __pyx_r = 'C';
19376  goto __pyx_L0;
19377 
19378  /* "View.MemoryView":1130
19379  * break
19380  *
19381  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
19382  * return 'C'
19383  * else:
19384  */
19385  }
19386 
19387  /* "View.MemoryView":1133
19388  * return 'C'
19389  * else:
19390  * return 'F' # <<<<<<<<<<<<<<
19391  *
19392  * @cython.cdivision(True)
19393  */
19394  /*else*/ {
19395  __pyx_r = 'F';
19396  goto __pyx_L0;
19397  }
19398 
19399  /* "View.MemoryView":1112
19400  *
19401  * @cname('__pyx_get_best_slice_order')
19402  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
19403  * """
19404  * Figure out the best memory access order for a given slice.
19405  */
19406 
19407  /* function exit code */
19408  __pyx_L1_error:;
19409  __Pyx_WriteUnraisable("View.MemoryView.get_best_order", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19410  __pyx_r = 0;
19411  __pyx_L0:;
19412  __Pyx_TraceReturn(Py_None, 1);
19413  return __pyx_r;
19414 }
19415 
19416 /* "View.MemoryView":1136
19417  *
19418  * @cython.cdivision(True)
19419  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
19420  * char *dst_data, Py_ssize_t *dst_strides,
19421  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
19422  */
19423 
19424 static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
19425  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
19426  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
19427  Py_ssize_t __pyx_v_dst_extent;
19428  Py_ssize_t __pyx_v_src_stride;
19429  Py_ssize_t __pyx_v_dst_stride;
19430  int __pyx_t_1;
19431  int __pyx_t_2;
19432  int __pyx_t_3;
19433  Py_ssize_t __pyx_t_4;
19434  Py_ssize_t __pyx_t_5;
19435  Py_ssize_t __pyx_t_6;
19436 
19437  /* "View.MemoryView":1143
19438  *
19439  * cdef Py_ssize_t i
19440  * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
19441  * cdef Py_ssize_t dst_extent = dst_shape[0]
19442  * cdef Py_ssize_t src_stride = src_strides[0]
19443  */
19444  __pyx_v_src_extent = (__pyx_v_src_shape[0]);
19445 
19446  /* "View.MemoryView":1144
19447  * cdef Py_ssize_t i
19448  * cdef Py_ssize_t src_extent = src_shape[0]
19449  * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
19450  * cdef Py_ssize_t src_stride = src_strides[0]
19451  * cdef Py_ssize_t dst_stride = dst_strides[0]
19452  */
19453  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
19454 
19455  /* "View.MemoryView":1145
19456  * cdef Py_ssize_t src_extent = src_shape[0]
19457  * cdef Py_ssize_t dst_extent = dst_shape[0]
19458  * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
19459  * cdef Py_ssize_t dst_stride = dst_strides[0]
19460  *
19461  */
19462  __pyx_v_src_stride = (__pyx_v_src_strides[0]);
19463 
19464  /* "View.MemoryView":1146
19465  * cdef Py_ssize_t dst_extent = dst_shape[0]
19466  * cdef Py_ssize_t src_stride = src_strides[0]
19467  * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
19468  *
19469  * if ndim == 1:
19470  */
19471  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
19472 
19473  /* "View.MemoryView":1148
19474  * cdef Py_ssize_t dst_stride = dst_strides[0]
19475  *
19476  * if ndim == 1: # <<<<<<<<<<<<<<
19477  * if (src_stride > 0 and dst_stride > 0 and
19478  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19479  */
19480  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
19481  if (__pyx_t_1) {
19482 
19483  /* "View.MemoryView":1149
19484  *
19485  * if ndim == 1:
19486  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
19487  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19488  * memcpy(dst_data, src_data, itemsize * dst_extent)
19489  */
19490  __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
19491  if (__pyx_t_2) {
19492  } else {
19493  __pyx_t_1 = __pyx_t_2;
19494  goto __pyx_L5_bool_binop_done;
19495  }
19496  __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
19497  if (__pyx_t_2) {
19498  } else {
19499  __pyx_t_1 = __pyx_t_2;
19500  goto __pyx_L5_bool_binop_done;
19501  }
19502 
19503  /* "View.MemoryView":1150
19504  * if ndim == 1:
19505  * if (src_stride > 0 and dst_stride > 0 and
19506  * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
19507  * memcpy(dst_data, src_data, itemsize * dst_extent)
19508  * else:
19509  */
19510  __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
19511  if (__pyx_t_2) {
19512  __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
19513  }
19514  __pyx_t_3 = (__pyx_t_2 != 0);
19515  __pyx_t_1 = __pyx_t_3;
19516  __pyx_L5_bool_binop_done:;
19517 
19518  /* "View.MemoryView":1149
19519  *
19520  * if ndim == 1:
19521  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
19522  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19523  * memcpy(dst_data, src_data, itemsize * dst_extent)
19524  */
19525  if (__pyx_t_1) {
19526 
19527  /* "View.MemoryView":1151
19528  * if (src_stride > 0 and dst_stride > 0 and
19529  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19530  * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
19531  * else:
19532  * for i in range(dst_extent):
19533  */
19534  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
19535 
19536  /* "View.MemoryView":1149
19537  *
19538  * if ndim == 1:
19539  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
19540  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19541  * memcpy(dst_data, src_data, itemsize * dst_extent)
19542  */
19543  goto __pyx_L4;
19544  }
19545 
19546  /* "View.MemoryView":1153
19547  * memcpy(dst_data, src_data, itemsize * dst_extent)
19548  * else:
19549  * for i in range(dst_extent): # <<<<<<<<<<<<<<
19550  * memcpy(dst_data, src_data, itemsize)
19551  * src_data += src_stride
19552  */
19553  /*else*/ {
19554  __pyx_t_4 = __pyx_v_dst_extent;
19555  __pyx_t_5 = __pyx_t_4;
19556  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19557  __pyx_v_i = __pyx_t_6;
19558 
19559  /* "View.MemoryView":1154
19560  * else:
19561  * for i in range(dst_extent):
19562  * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
19563  * src_data += src_stride
19564  * dst_data += dst_stride
19565  */
19566  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
19567 
19568  /* "View.MemoryView":1155
19569  * for i in range(dst_extent):
19570  * memcpy(dst_data, src_data, itemsize)
19571  * src_data += src_stride # <<<<<<<<<<<<<<
19572  * dst_data += dst_stride
19573  * else:
19574  */
19575  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
19576 
19577  /* "View.MemoryView":1156
19578  * memcpy(dst_data, src_data, itemsize)
19579  * src_data += src_stride
19580  * dst_data += dst_stride # <<<<<<<<<<<<<<
19581  * else:
19582  * for i in range(dst_extent):
19583  */
19584  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
19585  }
19586  }
19587  __pyx_L4:;
19588 
19589  /* "View.MemoryView":1148
19590  * cdef Py_ssize_t dst_stride = dst_strides[0]
19591  *
19592  * if ndim == 1: # <<<<<<<<<<<<<<
19593  * if (src_stride > 0 and dst_stride > 0 and
19594  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19595  */
19596  goto __pyx_L3;
19597  }
19598 
19599  /* "View.MemoryView":1158
19600  * dst_data += dst_stride
19601  * else:
19602  * for i in range(dst_extent): # <<<<<<<<<<<<<<
19603  * _copy_strided_to_strided(src_data, src_strides + 1,
19604  * dst_data, dst_strides + 1,
19605  */
19606  /*else*/ {
19607  __pyx_t_4 = __pyx_v_dst_extent;
19608  __pyx_t_5 = __pyx_t_4;
19609  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19610  __pyx_v_i = __pyx_t_6;
19611 
19612  /* "View.MemoryView":1159
19613  * else:
19614  * for i in range(dst_extent):
19615  * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
19616  * dst_data, dst_strides + 1,
19617  * src_shape + 1, dst_shape + 1,
19618  */
19619  _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
19620 
19621  /* "View.MemoryView":1163
19622  * src_shape + 1, dst_shape + 1,
19623  * ndim - 1, itemsize)
19624  * src_data += src_stride # <<<<<<<<<<<<<<
19625  * dst_data += dst_stride
19626  *
19627  */
19628  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
19629 
19630  /* "View.MemoryView":1164
19631  * ndim - 1, itemsize)
19632  * src_data += src_stride
19633  * dst_data += dst_stride # <<<<<<<<<<<<<<
19634  *
19635  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
19636  */
19637  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
19638  }
19639  }
19640  __pyx_L3:;
19641 
19642  /* "View.MemoryView":1136
19643  *
19644  * @cython.cdivision(True)
19645  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
19646  * char *dst_data, Py_ssize_t *dst_strides,
19647  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
19648  */
19649 
19650  /* function exit code */
19651 }
19652 
19653 /* "View.MemoryView":1166
19654  * dst_data += dst_stride
19655  *
19656  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19657  * __Pyx_memviewslice *dst,
19658  * int ndim, size_t itemsize) nogil:
19659  */
19660 
19661 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
19662  __Pyx_TraceDeclarations
19663  __Pyx_TraceCall("copy_strided_to_strided", __pyx_f[1], 1166, 1, __PYX_ERR(1, 1166, __pyx_L1_error));
19664 
19665  /* "View.MemoryView":1169
19666  * __Pyx_memviewslice *dst,
19667  * int ndim, size_t itemsize) nogil:
19668  * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
19669  * src.shape, dst.shape, ndim, itemsize)
19670  *
19671  */
19672  _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
19673 
19674  /* "View.MemoryView":1166
19675  * dst_data += dst_stride
19676  *
19677  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19678  * __Pyx_memviewslice *dst,
19679  * int ndim, size_t itemsize) nogil:
19680  */
19681 
19682  /* function exit code */
19683  goto __pyx_L0;
19684  __pyx_L1_error:;
19685  __Pyx_WriteUnraisable("View.MemoryView.copy_strided_to_strided", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19686  __pyx_L0:;
19687  __Pyx_TraceReturn(Py_None, 1);
19688 }
19689 
19690 /* "View.MemoryView":1173
19691  *
19692  * @cname('__pyx_memoryview_slice_get_size')
19693  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
19694  * "Return the size of the memory occupied by the slice in number of bytes"
19695  * cdef int i
19696  */
19697 
19698 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
19699  int __pyx_v_i;
19700  Py_ssize_t __pyx_v_size;
19701  Py_ssize_t __pyx_r;
19702  __Pyx_TraceDeclarations
19703  Py_ssize_t __pyx_t_1;
19704  int __pyx_t_2;
19705  int __pyx_t_3;
19706  int __pyx_t_4;
19707  __Pyx_TraceCall("slice_get_size", __pyx_f[1], 1173, 1, __PYX_ERR(1, 1173, __pyx_L1_error));
19708 
19709  /* "View.MemoryView":1176
19710  * "Return the size of the memory occupied by the slice in number of bytes"
19711  * cdef int i
19712  * cdef Py_ssize_t size = src.memview.view.itemsize # <<<<<<<<<<<<<<
19713  *
19714  * for i in range(ndim):
19715  */
19716  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19717  __pyx_v_size = __pyx_t_1;
19718 
19719  /* "View.MemoryView":1178
19720  * cdef Py_ssize_t size = src.memview.view.itemsize
19721  *
19722  * for i in range(ndim): # <<<<<<<<<<<<<<
19723  * size *= src.shape[i]
19724  *
19725  */
19726  __pyx_t_2 = __pyx_v_ndim;
19727  __pyx_t_3 = __pyx_t_2;
19728  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19729  __pyx_v_i = __pyx_t_4;
19730 
19731  /* "View.MemoryView":1179
19732  *
19733  * for i in range(ndim):
19734  * size *= src.shape[i] # <<<<<<<<<<<<<<
19735  *
19736  * return size
19737  */
19738  __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
19739  }
19740 
19741  /* "View.MemoryView":1181
19742  * size *= src.shape[i]
19743  *
19744  * return size # <<<<<<<<<<<<<<
19745  *
19746  * @cname('__pyx_fill_contig_strides_array')
19747  */
19748  __pyx_r = __pyx_v_size;
19749  goto __pyx_L0;
19750 
19751  /* "View.MemoryView":1173
19752  *
19753  * @cname('__pyx_memoryview_slice_get_size')
19754  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
19755  * "Return the size of the memory occupied by the slice in number of bytes"
19756  * cdef int i
19757  */
19758 
19759  /* function exit code */
19760  __pyx_L1_error:;
19761  __Pyx_WriteUnraisable("View.MemoryView.slice_get_size", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19762  __pyx_r = 0;
19763  __pyx_L0:;
19764  __Pyx_TraceReturn(Py_None, 1);
19765  return __pyx_r;
19766 }
19767 
19768 /* "View.MemoryView":1184
19769  *
19770  * @cname('__pyx_fill_contig_strides_array')
19771  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
19772  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
19773  * int ndim, char order) nogil:
19774  */
19775 
19776 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
19777  int __pyx_v_idx;
19778  Py_ssize_t __pyx_r;
19779  __Pyx_TraceDeclarations
19780  int __pyx_t_1;
19781  int __pyx_t_2;
19782  int __pyx_t_3;
19783  int __pyx_t_4;
19784  __Pyx_TraceCall("fill_contig_strides_array", __pyx_f[1], 1184, 1, __PYX_ERR(1, 1184, __pyx_L1_error));
19785 
19786  /* "View.MemoryView":1193
19787  * cdef int idx
19788  *
19789  * if order == 'F': # <<<<<<<<<<<<<<
19790  * for idx in range(ndim):
19791  * strides[idx] = stride
19792  */
19793  __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
19794  if (__pyx_t_1) {
19795 
19796  /* "View.MemoryView":1194
19797  *
19798  * if order == 'F':
19799  * for idx in range(ndim): # <<<<<<<<<<<<<<
19800  * strides[idx] = stride
19801  * stride = stride * shape[idx]
19802  */
19803  __pyx_t_2 = __pyx_v_ndim;
19804  __pyx_t_3 = __pyx_t_2;
19805  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19806  __pyx_v_idx = __pyx_t_4;
19807 
19808  /* "View.MemoryView":1195
19809  * if order == 'F':
19810  * for idx in range(ndim):
19811  * strides[idx] = stride # <<<<<<<<<<<<<<
19812  * stride = stride * shape[idx]
19813  * else:
19814  */
19815  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19816 
19817  /* "View.MemoryView":1196
19818  * for idx in range(ndim):
19819  * strides[idx] = stride
19820  * stride = stride * shape[idx] # <<<<<<<<<<<<<<
19821  * else:
19822  * for idx in range(ndim - 1, -1, -1):
19823  */
19824  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19825  }
19826 
19827  /* "View.MemoryView":1193
19828  * cdef int idx
19829  *
19830  * if order == 'F': # <<<<<<<<<<<<<<
19831  * for idx in range(ndim):
19832  * strides[idx] = stride
19833  */
19834  goto __pyx_L3;
19835  }
19836 
19837  /* "View.MemoryView":1198
19838  * stride = stride * shape[idx]
19839  * else:
19840  * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
19841  * strides[idx] = stride
19842  * stride = stride * shape[idx]
19843  */
19844  /*else*/ {
19845  for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
19846  __pyx_v_idx = __pyx_t_2;
19847 
19848  /* "View.MemoryView":1199
19849  * else:
19850  * for idx in range(ndim - 1, -1, -1):
19851  * strides[idx] = stride # <<<<<<<<<<<<<<
19852  * stride = stride * shape[idx]
19853  *
19854  */
19855  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19856 
19857  /* "View.MemoryView":1200
19858  * for idx in range(ndim - 1, -1, -1):
19859  * strides[idx] = stride
19860  * stride = stride * shape[idx] # <<<<<<<<<<<<<<
19861  *
19862  * return stride
19863  */
19864  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19865  }
19866  }
19867  __pyx_L3:;
19868 
19869  /* "View.MemoryView":1202
19870  * stride = stride * shape[idx]
19871  *
19872  * return stride # <<<<<<<<<<<<<<
19873  *
19874  * @cname('__pyx_memoryview_copy_data_to_temp')
19875  */
19876  __pyx_r = __pyx_v_stride;
19877  goto __pyx_L0;
19878 
19879  /* "View.MemoryView":1184
19880  *
19881  * @cname('__pyx_fill_contig_strides_array')
19882  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
19883  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
19884  * int ndim, char order) nogil:
19885  */
19886 
19887  /* function exit code */
19888  __pyx_L1_error:;
19889  __Pyx_WriteUnraisable("View.MemoryView.fill_contig_strides_array", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19890  __pyx_r = 0;
19891  __pyx_L0:;
19892  __Pyx_TraceReturn(Py_None, 1);
19893  return __pyx_r;
19894 }
19895 
19896 /* "View.MemoryView":1205
19897  *
19898  * @cname('__pyx_memoryview_copy_data_to_temp')
19899  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19900  * __Pyx_memviewslice *tmpslice,
19901  * char order,
19902  */
19903 
19904 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
19905  int __pyx_v_i;
19906  void *__pyx_v_result;
19907  size_t __pyx_v_itemsize;
19908  size_t __pyx_v_size;
19909  void *__pyx_r;
19910  __Pyx_TraceDeclarations
19911  Py_ssize_t __pyx_t_1;
19912  int __pyx_t_2;
19913  int __pyx_t_3;
19914  struct __pyx_memoryview_obj *__pyx_t_4;
19915  int __pyx_t_5;
19916  int __pyx_t_6;
19917  __Pyx_TraceCall("copy_data_to_temp", __pyx_f[1], 1205, 1, __PYX_ERR(1, 1205, __pyx_L1_error));
19918 
19919  /* "View.MemoryView":1216
19920  * cdef void *result
19921  *
19922  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
19923  * cdef size_t size = slice_get_size(src, ndim)
19924  *
19925  */
19926  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19927  __pyx_v_itemsize = __pyx_t_1;
19928 
19929  /* "View.MemoryView":1217
19930  *
19931  * cdef size_t itemsize = src.memview.view.itemsize
19932  * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
19933  *
19934  * result = malloc(size)
19935  */
19936  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
19937 
19938  /* "View.MemoryView":1219
19939  * cdef size_t size = slice_get_size(src, ndim)
19940  *
19941  * result = malloc(size) # <<<<<<<<<<<<<<
19942  * if not result:
19943  * _err(MemoryError, NULL)
19944  */
19945  __pyx_v_result = malloc(__pyx_v_size);
19946 
19947  /* "View.MemoryView":1220
19948  *
19949  * result = malloc(size)
19950  * if not result: # <<<<<<<<<<<<<<
19951  * _err(MemoryError, NULL)
19952  *
19953  */
19954  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
19955  if (__pyx_t_2) {
19956 
19957  /* "View.MemoryView":1221
19958  * result = malloc(size)
19959  * if not result:
19960  * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
19961  *
19962  *
19963  */
19964  __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1221, __pyx_L1_error)
19965 
19966  /* "View.MemoryView":1220
19967  *
19968  * result = malloc(size)
19969  * if not result: # <<<<<<<<<<<<<<
19970  * _err(MemoryError, NULL)
19971  *
19972  */
19973  }
19974 
19975  /* "View.MemoryView":1224
19976  *
19977  *
19978  * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
19979  * tmpslice.memview = src.memview
19980  * for i in range(ndim):
19981  */
19982  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
19983 
19984  /* "View.MemoryView":1225
19985  *
19986  * tmpslice.data = <char *> result
19987  * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
19988  * for i in range(ndim):
19989  * tmpslice.shape[i] = src.shape[i]
19990  */
19991  __pyx_t_4 = __pyx_v_src->memview;
19992  __pyx_v_tmpslice->memview = __pyx_t_4;
19993 
19994  /* "View.MemoryView":1226
19995  * tmpslice.data = <char *> result
19996  * tmpslice.memview = src.memview
19997  * for i in range(ndim): # <<<<<<<<<<<<<<
19998  * tmpslice.shape[i] = src.shape[i]
19999  * tmpslice.suboffsets[i] = -1
20000  */
20001  __pyx_t_3 = __pyx_v_ndim;
20002  __pyx_t_5 = __pyx_t_3;
20003  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
20004  __pyx_v_i = __pyx_t_6;
20005 
20006  /* "View.MemoryView":1227
20007  * tmpslice.memview = src.memview
20008  * for i in range(ndim):
20009  * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
20010  * tmpslice.suboffsets[i] = -1
20011  *
20012  */
20013  (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
20014 
20015  /* "View.MemoryView":1228
20016  * for i in range(ndim):
20017  * tmpslice.shape[i] = src.shape[i]
20018  * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
20019  *
20020  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
20021  */
20022  (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
20023  }
20024 
20025  /* "View.MemoryView":1230
20026  * tmpslice.suboffsets[i] = -1
20027  *
20028  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
20029  * ndim, order)
20030  *
20031  */
20032  (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
20033 
20034  /* "View.MemoryView":1234
20035  *
20036  *
20037  * for i in range(ndim): # <<<<<<<<<<<<<<
20038  * if tmpslice.shape[i] == 1:
20039  * tmpslice.strides[i] = 0
20040  */
20041  __pyx_t_3 = __pyx_v_ndim;
20042  __pyx_t_5 = __pyx_t_3;
20043  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
20044  __pyx_v_i = __pyx_t_6;
20045 
20046  /* "View.MemoryView":1235
20047  *
20048  * for i in range(ndim):
20049  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
20050  * tmpslice.strides[i] = 0
20051  *
20052  */
20053  __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
20054  if (__pyx_t_2) {
20055 
20056  /* "View.MemoryView":1236
20057  * for i in range(ndim):
20058  * if tmpslice.shape[i] == 1:
20059  * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
20060  *
20061  * if slice_is_contig(src[0], order, ndim):
20062  */
20063  (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
20064 
20065  /* "View.MemoryView":1235
20066  *
20067  * for i in range(ndim):
20068  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
20069  * tmpslice.strides[i] = 0
20070  *
20071  */
20072  }
20073  }
20074 
20075  /* "View.MemoryView":1238
20076  * tmpslice.strides[i] = 0
20077  *
20078  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
20079  * memcpy(result, src.data, size)
20080  * else:
20081  */
20082  __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
20083  if (__pyx_t_2) {
20084 
20085  /* "View.MemoryView":1239
20086  *
20087  * if slice_is_contig(src[0], order, ndim):
20088  * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
20089  * else:
20090  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
20091  */
20092  (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
20093 
20094  /* "View.MemoryView":1238
20095  * tmpslice.strides[i] = 0
20096  *
20097  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
20098  * memcpy(result, src.data, size)
20099  * else:
20100  */
20101  goto __pyx_L9;
20102  }
20103 
20104  /* "View.MemoryView":1241
20105  * memcpy(result, src.data, size)
20106  * else:
20107  * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
20108  *
20109  * return result
20110  */
20111  /*else*/ {
20112  copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
20113  }
20114  __pyx_L9:;
20115 
20116  /* "View.MemoryView":1243
20117  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
20118  *
20119  * return result # <<<<<<<<<<<<<<
20120  *
20121  *
20122  */
20123  __pyx_r = __pyx_v_result;
20124  goto __pyx_L0;
20125 
20126  /* "View.MemoryView":1205
20127  *
20128  * @cname('__pyx_memoryview_copy_data_to_temp')
20129  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
20130  * __Pyx_memviewslice *tmpslice,
20131  * char order,
20132  */
20133 
20134  /* function exit code */
20135  __pyx_L1_error:;
20136  {
20137  #ifdef WITH_THREAD
20138  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20139  #endif
20140  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
20141  #ifdef WITH_THREAD
20142  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20143  #endif
20144  }
20145  __pyx_r = NULL;
20146  __pyx_L0:;
20147  __Pyx_TraceReturn(Py_None, 1);
20148  return __pyx_r;
20149 }
20150 
20151 /* "View.MemoryView":1248
20152  *
20153  * @cname('__pyx_memoryview_err_extents')
20154  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
20155  * Py_ssize_t extent2) except -1 with gil:
20156  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
20157  */
20158 
20159 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
20160  int __pyx_r;
20161  __Pyx_TraceDeclarations
20162  __Pyx_RefNannyDeclarations
20163  PyObject *__pyx_t_1 = NULL;
20164  PyObject *__pyx_t_2 = NULL;
20165  PyObject *__pyx_t_3 = NULL;
20166  PyObject *__pyx_t_4 = NULL;
20167  #ifdef WITH_THREAD
20168  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20169  #endif
20170  __Pyx_RefNannySetupContext("_err_extents", 0);
20171  __Pyx_TraceCall("_err_extents", __pyx_f[1], 1248, 0, __PYX_ERR(1, 1248, __pyx_L1_error));
20172 
20173  /* "View.MemoryView":1251
20174  * Py_ssize_t extent2) except -1 with gil:
20175  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
20176  * (i, extent1, extent2)) # <<<<<<<<<<<<<<
20177  *
20178  * @cname('__pyx_memoryview_err_dim')
20179  */
20180  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1251, __pyx_L1_error)
20181  __Pyx_GOTREF(__pyx_t_1);
20182  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1251, __pyx_L1_error)
20183  __Pyx_GOTREF(__pyx_t_2);
20184  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1251, __pyx_L1_error)
20185  __Pyx_GOTREF(__pyx_t_3);
20186  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1251, __pyx_L1_error)
20187  __Pyx_GOTREF(__pyx_t_4);
20188  __Pyx_GIVEREF(__pyx_t_1);
20189  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
20190  __Pyx_GIVEREF(__pyx_t_2);
20191  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
20192  __Pyx_GIVEREF(__pyx_t_3);
20193  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
20194  __pyx_t_1 = 0;
20195  __pyx_t_2 = 0;
20196  __pyx_t_3 = 0;
20197 
20198  /* "View.MemoryView":1250
20199  * cdef int _err_extents(int i, Py_ssize_t extent1,
20200  * Py_ssize_t extent2) except -1 with gil:
20201  * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
20202  * (i, extent1, extent2))
20203  *
20204  */
20205  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1250, __pyx_L1_error)
20206  __Pyx_GOTREF(__pyx_t_3);
20207  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20208  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1250, __pyx_L1_error)
20209  __Pyx_GOTREF(__pyx_t_4);
20210  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20211  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
20212  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20213  __PYX_ERR(1, 1250, __pyx_L1_error)
20214 
20215  /* "View.MemoryView":1248
20216  *
20217  * @cname('__pyx_memoryview_err_extents')
20218  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
20219  * Py_ssize_t extent2) except -1 with gil:
20220  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
20221  */
20222 
20223  /* function exit code */
20224  __pyx_L1_error:;
20225  __Pyx_XDECREF(__pyx_t_1);
20226  __Pyx_XDECREF(__pyx_t_2);
20227  __Pyx_XDECREF(__pyx_t_3);
20228  __Pyx_XDECREF(__pyx_t_4);
20229  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
20230  __pyx_r = -1;
20231  __Pyx_TraceReturn(Py_None, 0);
20232  __Pyx_RefNannyFinishContext();
20233  #ifdef WITH_THREAD
20234  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20235  #endif
20236  return __pyx_r;
20237 }
20238 
20239 /* "View.MemoryView":1254
20240  *
20241  * @cname('__pyx_memoryview_err_dim')
20242  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
20243  * raise error(msg.decode('ascii') % dim)
20244  *
20245  */
20246 
20247 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
20248  int __pyx_r;
20249  __Pyx_TraceDeclarations
20250  __Pyx_RefNannyDeclarations
20251  PyObject *__pyx_t_1 = NULL;
20252  PyObject *__pyx_t_2 = NULL;
20253  PyObject *__pyx_t_3 = NULL;
20254  PyObject *__pyx_t_4 = NULL;
20255  #ifdef WITH_THREAD
20256  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20257  #endif
20258  __Pyx_RefNannySetupContext("_err_dim", 0);
20259  __Pyx_TraceCall("_err_dim", __pyx_f[1], 1254, 0, __PYX_ERR(1, 1254, __pyx_L1_error));
20260  __Pyx_INCREF(__pyx_v_error);
20261 
20262  /* "View.MemoryView":1255
20263  * @cname('__pyx_memoryview_err_dim')
20264  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
20265  * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
20266  *
20267  * @cname('__pyx_memoryview_err')
20268  */
20269  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1255, __pyx_L1_error)
20270  __Pyx_GOTREF(__pyx_t_2);
20271  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1255, __pyx_L1_error)
20272  __Pyx_GOTREF(__pyx_t_3);
20273  __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1255, __pyx_L1_error)
20274  __Pyx_GOTREF(__pyx_t_4);
20275  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20276  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20277  __Pyx_INCREF(__pyx_v_error);
20278  __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
20279  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
20280  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
20281  if (likely(__pyx_t_2)) {
20282  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
20283  __Pyx_INCREF(__pyx_t_2);
20284  __Pyx_INCREF(function);
20285  __Pyx_DECREF_SET(__pyx_t_3, function);
20286  }
20287  }
20288  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
20289  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20290  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20291  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1255, __pyx_L1_error)
20292  __Pyx_GOTREF(__pyx_t_1);
20293  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20294  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
20295  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20296  __PYX_ERR(1, 1255, __pyx_L1_error)
20297 
20298  /* "View.MemoryView":1254
20299  *
20300  * @cname('__pyx_memoryview_err_dim')
20301  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
20302  * raise error(msg.decode('ascii') % dim)
20303  *
20304  */
20305 
20306  /* function exit code */
20307  __pyx_L1_error:;
20308  __Pyx_XDECREF(__pyx_t_1);
20309  __Pyx_XDECREF(__pyx_t_2);
20310  __Pyx_XDECREF(__pyx_t_3);
20311  __Pyx_XDECREF(__pyx_t_4);
20312  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
20313  __pyx_r = -1;
20314  __Pyx_XDECREF(__pyx_v_error);
20315  __Pyx_TraceReturn(Py_None, 0);
20316  __Pyx_RefNannyFinishContext();
20317  #ifdef WITH_THREAD
20318  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20319  #endif
20320  return __pyx_r;
20321 }
20322 
20323 /* "View.MemoryView":1258
20324  *
20325  * @cname('__pyx_memoryview_err')
20326  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
20327  * if msg != NULL:
20328  * raise error(msg.decode('ascii'))
20329  */
20330 
20331 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
20332  int __pyx_r;
20333  __Pyx_TraceDeclarations
20334  __Pyx_RefNannyDeclarations
20335  int __pyx_t_1;
20336  PyObject *__pyx_t_2 = NULL;
20337  PyObject *__pyx_t_3 = NULL;
20338  PyObject *__pyx_t_4 = NULL;
20339  PyObject *__pyx_t_5 = NULL;
20340  #ifdef WITH_THREAD
20341  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20342  #endif
20343  __Pyx_RefNannySetupContext("_err", 0);
20344  __Pyx_TraceCall("_err", __pyx_f[1], 1258, 0, __PYX_ERR(1, 1258, __pyx_L1_error));
20345  __Pyx_INCREF(__pyx_v_error);
20346 
20347  /* "View.MemoryView":1259
20348  * @cname('__pyx_memoryview_err')
20349  * cdef int _err(object error, char *msg) except -1 with gil:
20350  * if msg != NULL: # <<<<<<<<<<<<<<
20351  * raise error(msg.decode('ascii'))
20352  * else:
20353  */
20354  __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
20355  if (unlikely(__pyx_t_1)) {
20356 
20357  /* "View.MemoryView":1260
20358  * cdef int _err(object error, char *msg) except -1 with gil:
20359  * if msg != NULL:
20360  * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
20361  * else:
20362  * raise error
20363  */
20364  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1260, __pyx_L1_error)
20365  __Pyx_GOTREF(__pyx_t_3);
20366  __Pyx_INCREF(__pyx_v_error);
20367  __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
20368  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
20369  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
20370  if (likely(__pyx_t_5)) {
20371  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
20372  __Pyx_INCREF(__pyx_t_5);
20373  __Pyx_INCREF(function);
20374  __Pyx_DECREF_SET(__pyx_t_4, function);
20375  }
20376  }
20377  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
20378  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20379  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20380  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1260, __pyx_L1_error)
20381  __Pyx_GOTREF(__pyx_t_2);
20382  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20383  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
20384  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20385  __PYX_ERR(1, 1260, __pyx_L1_error)
20386 
20387  /* "View.MemoryView":1259
20388  * @cname('__pyx_memoryview_err')
20389  * cdef int _err(object error, char *msg) except -1 with gil:
20390  * if msg != NULL: # <<<<<<<<<<<<<<
20391  * raise error(msg.decode('ascii'))
20392  * else:
20393  */
20394  }
20395 
20396  /* "View.MemoryView":1262
20397  * raise error(msg.decode('ascii'))
20398  * else:
20399  * raise error # <<<<<<<<<<<<<<
20400  *
20401  * @cname('__pyx_memoryview_copy_contents')
20402  */
20403  /*else*/ {
20404  __Pyx_Raise(__pyx_v_error, 0, 0, 0);
20405  __PYX_ERR(1, 1262, __pyx_L1_error)
20406  }
20407 
20408  /* "View.MemoryView":1258
20409  *
20410  * @cname('__pyx_memoryview_err')
20411  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
20412  * if msg != NULL:
20413  * raise error(msg.decode('ascii'))
20414  */
20415 
20416  /* function exit code */
20417  __pyx_L1_error:;
20418  __Pyx_XDECREF(__pyx_t_2);
20419  __Pyx_XDECREF(__pyx_t_3);
20420  __Pyx_XDECREF(__pyx_t_4);
20421  __Pyx_XDECREF(__pyx_t_5);
20422  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
20423  __pyx_r = -1;
20424  __Pyx_XDECREF(__pyx_v_error);
20425  __Pyx_TraceReturn(Py_None, 0);
20426  __Pyx_RefNannyFinishContext();
20427  #ifdef WITH_THREAD
20428  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20429  #endif
20430  return __pyx_r;
20431 }
20432 
20433 /* "View.MemoryView":1265
20434  *
20435  * @cname('__pyx_memoryview_copy_contents')
20436  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
20437  * __Pyx_memviewslice dst,
20438  * int src_ndim, int dst_ndim,
20439  */
20440 
20441 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
20442  void *__pyx_v_tmpdata;
20443  size_t __pyx_v_itemsize;
20444  int __pyx_v_i;
20445  char __pyx_v_order;
20446  int __pyx_v_broadcasting;
20447  int __pyx_v_direct_copy;
20448  __Pyx_memviewslice __pyx_v_tmp;
20449  int __pyx_v_ndim;
20450  int __pyx_r;
20451  __Pyx_TraceDeclarations
20452  Py_ssize_t __pyx_t_1;
20453  int __pyx_t_2;
20454  int __pyx_t_3;
20455  int __pyx_t_4;
20456  int __pyx_t_5;
20457  int __pyx_t_6;
20458  void *__pyx_t_7;
20459  int __pyx_t_8;
20460  __Pyx_TraceCall("memoryview_copy_contents", __pyx_f[1], 1265, 1, __PYX_ERR(1, 1265, __pyx_L1_error));
20461 
20462  /* "View.MemoryView":1273
20463  * Check for overlapping memory and verify the shapes.
20464  * """
20465  * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
20466  * cdef size_t itemsize = src.memview.view.itemsize
20467  * cdef int i
20468  */
20469  __pyx_v_tmpdata = NULL;
20470 
20471  /* "View.MemoryView":1274
20472  * """
20473  * cdef void *tmpdata = NULL
20474  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
20475  * cdef int i
20476  * cdef char order = get_best_order(&src, src_ndim)
20477  */
20478  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
20479  __pyx_v_itemsize = __pyx_t_1;
20480 
20481  /* "View.MemoryView":1276
20482  * cdef size_t itemsize = src.memview.view.itemsize
20483  * cdef int i
20484  * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
20485  * cdef bint broadcasting = False
20486  * cdef bint direct_copy = False
20487  */
20488  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
20489 
20490  /* "View.MemoryView":1277
20491  * cdef int i
20492  * cdef char order = get_best_order(&src, src_ndim)
20493  * cdef bint broadcasting = False # <<<<<<<<<<<<<<
20494  * cdef bint direct_copy = False
20495  * cdef __Pyx_memviewslice tmp
20496  */
20497  __pyx_v_broadcasting = 0;
20498 
20499  /* "View.MemoryView":1278
20500  * cdef char order = get_best_order(&src, src_ndim)
20501  * cdef bint broadcasting = False
20502  * cdef bint direct_copy = False # <<<<<<<<<<<<<<
20503  * cdef __Pyx_memviewslice tmp
20504  *
20505  */
20506  __pyx_v_direct_copy = 0;
20507 
20508  /* "View.MemoryView":1281
20509  * cdef __Pyx_memviewslice tmp
20510  *
20511  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
20512  * broadcast_leading(&src, src_ndim, dst_ndim)
20513  * elif dst_ndim < src_ndim:
20514  */
20515  __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
20516  if (__pyx_t_2) {
20517 
20518  /* "View.MemoryView":1282
20519  *
20520  * if src_ndim < dst_ndim:
20521  * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
20522  * elif dst_ndim < src_ndim:
20523  * broadcast_leading(&dst, dst_ndim, src_ndim)
20524  */
20525  __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
20526 
20527  /* "View.MemoryView":1281
20528  * cdef __Pyx_memviewslice tmp
20529  *
20530  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
20531  * broadcast_leading(&src, src_ndim, dst_ndim)
20532  * elif dst_ndim < src_ndim:
20533  */
20534  goto __pyx_L3;
20535  }
20536 
20537  /* "View.MemoryView":1283
20538  * if src_ndim < dst_ndim:
20539  * broadcast_leading(&src, src_ndim, dst_ndim)
20540  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
20541  * broadcast_leading(&dst, dst_ndim, src_ndim)
20542  *
20543  */
20544  __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
20545  if (__pyx_t_2) {
20546 
20547  /* "View.MemoryView":1284
20548  * broadcast_leading(&src, src_ndim, dst_ndim)
20549  * elif dst_ndim < src_ndim:
20550  * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
20551  *
20552  * cdef int ndim = max(src_ndim, dst_ndim)
20553  */
20554  __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
20555 
20556  /* "View.MemoryView":1283
20557  * if src_ndim < dst_ndim:
20558  * broadcast_leading(&src, src_ndim, dst_ndim)
20559  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
20560  * broadcast_leading(&dst, dst_ndim, src_ndim)
20561  *
20562  */
20563  }
20564  __pyx_L3:;
20565 
20566  /* "View.MemoryView":1286
20567  * broadcast_leading(&dst, dst_ndim, src_ndim)
20568  *
20569  * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
20570  *
20571  * for i in range(ndim):
20572  */
20573  __pyx_t_3 = __pyx_v_dst_ndim;
20574  __pyx_t_4 = __pyx_v_src_ndim;
20575  if (((__pyx_t_3 > __pyx_t_4) != 0)) {
20576  __pyx_t_5 = __pyx_t_3;
20577  } else {
20578  __pyx_t_5 = __pyx_t_4;
20579  }
20580  __pyx_v_ndim = __pyx_t_5;
20581 
20582  /* "View.MemoryView":1288
20583  * cdef int ndim = max(src_ndim, dst_ndim)
20584  *
20585  * for i in range(ndim): # <<<<<<<<<<<<<<
20586  * if src.shape[i] != dst.shape[i]:
20587  * if src.shape[i] == 1:
20588  */
20589  __pyx_t_5 = __pyx_v_ndim;
20590  __pyx_t_3 = __pyx_t_5;
20591  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20592  __pyx_v_i = __pyx_t_4;
20593 
20594  /* "View.MemoryView":1289
20595  *
20596  * for i in range(ndim):
20597  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
20598  * if src.shape[i] == 1:
20599  * broadcasting = True
20600  */
20601  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
20602  if (__pyx_t_2) {
20603 
20604  /* "View.MemoryView":1290
20605  * for i in range(ndim):
20606  * if src.shape[i] != dst.shape[i]:
20607  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
20608  * broadcasting = True
20609  * src.strides[i] = 0
20610  */
20611  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
20612  if (__pyx_t_2) {
20613 
20614  /* "View.MemoryView":1291
20615  * if src.shape[i] != dst.shape[i]:
20616  * if src.shape[i] == 1:
20617  * broadcasting = True # <<<<<<<<<<<<<<
20618  * src.strides[i] = 0
20619  * else:
20620  */
20621  __pyx_v_broadcasting = 1;
20622 
20623  /* "View.MemoryView":1292
20624  * if src.shape[i] == 1:
20625  * broadcasting = True
20626  * src.strides[i] = 0 # <<<<<<<<<<<<<<
20627  * else:
20628  * _err_extents(i, dst.shape[i], src.shape[i])
20629  */
20630  (__pyx_v_src.strides[__pyx_v_i]) = 0;
20631 
20632  /* "View.MemoryView":1290
20633  * for i in range(ndim):
20634  * if src.shape[i] != dst.shape[i]:
20635  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
20636  * broadcasting = True
20637  * src.strides[i] = 0
20638  */
20639  goto __pyx_L7;
20640  }
20641 
20642  /* "View.MemoryView":1294
20643  * src.strides[i] = 0
20644  * else:
20645  * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
20646  *
20647  * if src.suboffsets[i] >= 0:
20648  */
20649  /*else*/ {
20650  __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1294, __pyx_L1_error)
20651  }
20652  __pyx_L7:;
20653 
20654  /* "View.MemoryView":1289
20655  *
20656  * for i in range(ndim):
20657  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
20658  * if src.shape[i] == 1:
20659  * broadcasting = True
20660  */
20661  }
20662 
20663  /* "View.MemoryView":1296
20664  * _err_extents(i, dst.shape[i], src.shape[i])
20665  *
20666  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
20667  * _err_dim(ValueError, "Dimension %d is not direct", i)
20668  *
20669  */
20670  __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
20671  if (__pyx_t_2) {
20672 
20673  /* "View.MemoryView":1297
20674  *
20675  * if src.suboffsets[i] >= 0:
20676  * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
20677  *
20678  * if slices_overlap(&src, &dst, ndim, itemsize):
20679  */
20680  __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
20681 
20682  /* "View.MemoryView":1296
20683  * _err_extents(i, dst.shape[i], src.shape[i])
20684  *
20685  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
20686  * _err_dim(ValueError, "Dimension %d is not direct", i)
20687  *
20688  */
20689  }
20690  }
20691 
20692  /* "View.MemoryView":1299
20693  * _err_dim(ValueError, "Dimension %d is not direct", i)
20694  *
20695  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
20696  *
20697  * if not slice_is_contig(src, order, ndim):
20698  */
20699  __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
20700  if (__pyx_t_2) {
20701 
20702  /* "View.MemoryView":1301
20703  * if slices_overlap(&src, &dst, ndim, itemsize):
20704  *
20705  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
20706  * order = get_best_order(&dst, ndim)
20707  *
20708  */
20709  __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
20710  if (__pyx_t_2) {
20711 
20712  /* "View.MemoryView":1302
20713  *
20714  * if not slice_is_contig(src, order, ndim):
20715  * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
20716  *
20717  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
20718  */
20719  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
20720 
20721  /* "View.MemoryView":1301
20722  * if slices_overlap(&src, &dst, ndim, itemsize):
20723  *
20724  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
20725  * order = get_best_order(&dst, ndim)
20726  *
20727  */
20728  }
20729 
20730  /* "View.MemoryView":1304
20731  * order = get_best_order(&dst, ndim)
20732  *
20733  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
20734  * src = tmp
20735  *
20736  */
20737  __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1304, __pyx_L1_error)
20738  __pyx_v_tmpdata = __pyx_t_7;
20739 
20740  /* "View.MemoryView":1305
20741  *
20742  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
20743  * src = tmp # <<<<<<<<<<<<<<
20744  *
20745  * if not broadcasting:
20746  */
20747  __pyx_v_src = __pyx_v_tmp;
20748 
20749  /* "View.MemoryView":1299
20750  * _err_dim(ValueError, "Dimension %d is not direct", i)
20751  *
20752  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
20753  *
20754  * if not slice_is_contig(src, order, ndim):
20755  */
20756  }
20757 
20758  /* "View.MemoryView":1307
20759  * src = tmp
20760  *
20761  * if not broadcasting: # <<<<<<<<<<<<<<
20762  *
20763  *
20764  */
20765  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
20766  if (__pyx_t_2) {
20767 
20768  /* "View.MemoryView":1310
20769  *
20770  *
20771  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
20772  * direct_copy = slice_is_contig(dst, 'C', ndim)
20773  * elif slice_is_contig(src, 'F', ndim):
20774  */
20775  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
20776  if (__pyx_t_2) {
20777 
20778  /* "View.MemoryView":1311
20779  *
20780  * if slice_is_contig(src, 'C', ndim):
20781  * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
20782  * elif slice_is_contig(src, 'F', ndim):
20783  * direct_copy = slice_is_contig(dst, 'F', ndim)
20784  */
20785  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
20786 
20787  /* "View.MemoryView":1310
20788  *
20789  *
20790  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
20791  * direct_copy = slice_is_contig(dst, 'C', ndim)
20792  * elif slice_is_contig(src, 'F', ndim):
20793  */
20794  goto __pyx_L12;
20795  }
20796 
20797  /* "View.MemoryView":1312
20798  * if slice_is_contig(src, 'C', ndim):
20799  * direct_copy = slice_is_contig(dst, 'C', ndim)
20800  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
20801  * direct_copy = slice_is_contig(dst, 'F', ndim)
20802  *
20803  */
20804  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
20805  if (__pyx_t_2) {
20806 
20807  /* "View.MemoryView":1313
20808  * direct_copy = slice_is_contig(dst, 'C', ndim)
20809  * elif slice_is_contig(src, 'F', ndim):
20810  * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
20811  *
20812  * if direct_copy:
20813  */
20814  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
20815 
20816  /* "View.MemoryView":1312
20817  * if slice_is_contig(src, 'C', ndim):
20818  * direct_copy = slice_is_contig(dst, 'C', ndim)
20819  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
20820  * direct_copy = slice_is_contig(dst, 'F', ndim)
20821  *
20822  */
20823  }
20824  __pyx_L12:;
20825 
20826  /* "View.MemoryView":1315
20827  * direct_copy = slice_is_contig(dst, 'F', ndim)
20828  *
20829  * if direct_copy: # <<<<<<<<<<<<<<
20830  *
20831  * refcount_copying(&dst, dtype_is_object, ndim, False)
20832  */
20833  __pyx_t_2 = (__pyx_v_direct_copy != 0);
20834  if (__pyx_t_2) {
20835 
20836  /* "View.MemoryView":1317
20837  * if direct_copy:
20838  *
20839  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20840  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20841  * refcount_copying(&dst, dtype_is_object, ndim, True)
20842  */
20843  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20844 
20845  /* "View.MemoryView":1318
20846  *
20847  * refcount_copying(&dst, dtype_is_object, ndim, False)
20848  * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
20849  * refcount_copying(&dst, dtype_is_object, ndim, True)
20850  * free(tmpdata)
20851  */
20852  (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
20853 
20854  /* "View.MemoryView":1319
20855  * refcount_copying(&dst, dtype_is_object, ndim, False)
20856  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20857  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20858  * free(tmpdata)
20859  * return 0
20860  */
20861  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20862 
20863  /* "View.MemoryView":1320
20864  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20865  * refcount_copying(&dst, dtype_is_object, ndim, True)
20866  * free(tmpdata) # <<<<<<<<<<<<<<
20867  * return 0
20868  *
20869  */
20870  free(__pyx_v_tmpdata);
20871 
20872  /* "View.MemoryView":1321
20873  * refcount_copying(&dst, dtype_is_object, ndim, True)
20874  * free(tmpdata)
20875  * return 0 # <<<<<<<<<<<<<<
20876  *
20877  * if order == 'F' == get_best_order(&dst, ndim):
20878  */
20879  __pyx_r = 0;
20880  goto __pyx_L0;
20881 
20882  /* "View.MemoryView":1315
20883  * direct_copy = slice_is_contig(dst, 'F', ndim)
20884  *
20885  * if direct_copy: # <<<<<<<<<<<<<<
20886  *
20887  * refcount_copying(&dst, dtype_is_object, ndim, False)
20888  */
20889  }
20890 
20891  /* "View.MemoryView":1307
20892  * src = tmp
20893  *
20894  * if not broadcasting: # <<<<<<<<<<<<<<
20895  *
20896  *
20897  */
20898  }
20899 
20900  /* "View.MemoryView":1323
20901  * return 0
20902  *
20903  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
20904  *
20905  *
20906  */
20907  __pyx_t_2 = (__pyx_v_order == 'F');
20908  if (__pyx_t_2) {
20909  __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
20910  }
20911  __pyx_t_8 = (__pyx_t_2 != 0);
20912  if (__pyx_t_8) {
20913 
20914  /* "View.MemoryView":1326
20915  *
20916  *
20917  * transpose_memslice(&src) # <<<<<<<<<<<<<<
20918  * transpose_memslice(&dst)
20919  *
20920  */
20921  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1326, __pyx_L1_error)
20922 
20923  /* "View.MemoryView":1327
20924  *
20925  * transpose_memslice(&src)
20926  * transpose_memslice(&dst) # <<<<<<<<<<<<<<
20927  *
20928  * refcount_copying(&dst, dtype_is_object, ndim, False)
20929  */
20930  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1327, __pyx_L1_error)
20931 
20932  /* "View.MemoryView":1323
20933  * return 0
20934  *
20935  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
20936  *
20937  *
20938  */
20939  }
20940 
20941  /* "View.MemoryView":1329
20942  * transpose_memslice(&dst)
20943  *
20944  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20945  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
20946  * refcount_copying(&dst, dtype_is_object, ndim, True)
20947  */
20948  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20949 
20950  /* "View.MemoryView":1330
20951  *
20952  * refcount_copying(&dst, dtype_is_object, ndim, False)
20953  * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
20954  * refcount_copying(&dst, dtype_is_object, ndim, True)
20955  *
20956  */
20957  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
20958 
20959  /* "View.MemoryView":1331
20960  * refcount_copying(&dst, dtype_is_object, ndim, False)
20961  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
20962  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20963  *
20964  * free(tmpdata)
20965  */
20966  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20967 
20968  /* "View.MemoryView":1333
20969  * refcount_copying(&dst, dtype_is_object, ndim, True)
20970  *
20971  * free(tmpdata) # <<<<<<<<<<<<<<
20972  * return 0
20973  *
20974  */
20975  free(__pyx_v_tmpdata);
20976 
20977  /* "View.MemoryView":1334
20978  *
20979  * free(tmpdata)
20980  * return 0 # <<<<<<<<<<<<<<
20981  *
20982  * @cname('__pyx_memoryview_broadcast_leading')
20983  */
20984  __pyx_r = 0;
20985  goto __pyx_L0;
20986 
20987  /* "View.MemoryView":1265
20988  *
20989  * @cname('__pyx_memoryview_copy_contents')
20990  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
20991  * __Pyx_memviewslice dst,
20992  * int src_ndim, int dst_ndim,
20993  */
20994 
20995  /* function exit code */
20996  __pyx_L1_error:;
20997  {
20998  #ifdef WITH_THREAD
20999  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
21000  #endif
21001  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
21002  #ifdef WITH_THREAD
21003  __Pyx_PyGILState_Release(__pyx_gilstate_save);
21004  #endif
21005  }
21006  __pyx_r = -1;
21007  __pyx_L0:;
21008  __Pyx_TraceReturn(Py_None, 1);
21009  return __pyx_r;
21010 }
21011 
21012 /* "View.MemoryView":1337
21013  *
21014  * @cname('__pyx_memoryview_broadcast_leading')
21015  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
21016  * int ndim,
21017  * int ndim_other) nogil:
21018  */
21019 
21020 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
21021  int __pyx_v_i;
21022  int __pyx_v_offset;
21023  __Pyx_TraceDeclarations
21024  int __pyx_t_1;
21025  int __pyx_t_2;
21026  int __pyx_t_3;
21027  __Pyx_TraceCall("broadcast_leading", __pyx_f[1], 1337, 1, __PYX_ERR(1, 1337, __pyx_L1_error));
21028 
21029  /* "View.MemoryView":1341
21030  * int ndim_other) nogil:
21031  * cdef int i
21032  * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
21033  *
21034  * for i in range(ndim - 1, -1, -1):
21035  */
21036  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
21037 
21038  /* "View.MemoryView":1343
21039  * cdef int offset = ndim_other - ndim
21040  *
21041  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
21042  * mslice.shape[i + offset] = mslice.shape[i]
21043  * mslice.strides[i + offset] = mslice.strides[i]
21044  */
21045  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
21046  __pyx_v_i = __pyx_t_1;
21047 
21048  /* "View.MemoryView":1344
21049  *
21050  * for i in range(ndim - 1, -1, -1):
21051  * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
21052  * mslice.strides[i + offset] = mslice.strides[i]
21053  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
21054  */
21055  (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
21056 
21057  /* "View.MemoryView":1345
21058  * for i in range(ndim - 1, -1, -1):
21059  * mslice.shape[i + offset] = mslice.shape[i]
21060  * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
21061  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
21062  *
21063  */
21064  (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
21065 
21066  /* "View.MemoryView":1346
21067  * mslice.shape[i + offset] = mslice.shape[i]
21068  * mslice.strides[i + offset] = mslice.strides[i]
21069  * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
21070  *
21071  * for i in range(offset):
21072  */
21073  (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
21074  }
21075 
21076  /* "View.MemoryView":1348
21077  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
21078  *
21079  * for i in range(offset): # <<<<<<<<<<<<<<
21080  * mslice.shape[i] = 1
21081  * mslice.strides[i] = mslice.strides[0]
21082  */
21083  __pyx_t_1 = __pyx_v_offset;
21084  __pyx_t_2 = __pyx_t_1;
21085  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
21086  __pyx_v_i = __pyx_t_3;
21087 
21088  /* "View.MemoryView":1349
21089  *
21090  * for i in range(offset):
21091  * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
21092  * mslice.strides[i] = mslice.strides[0]
21093  * mslice.suboffsets[i] = -1
21094  */
21095  (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
21096 
21097  /* "View.MemoryView":1350
21098  * for i in range(offset):
21099  * mslice.shape[i] = 1
21100  * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
21101  * mslice.suboffsets[i] = -1
21102  *
21103  */
21104  (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
21105 
21106  /* "View.MemoryView":1351
21107  * mslice.shape[i] = 1
21108  * mslice.strides[i] = mslice.strides[0]
21109  * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
21110  *
21111  *
21112  */
21113  (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
21114  }
21115 
21116  /* "View.MemoryView":1337
21117  *
21118  * @cname('__pyx_memoryview_broadcast_leading')
21119  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
21120  * int ndim,
21121  * int ndim_other) nogil:
21122  */
21123 
21124  /* function exit code */
21125  goto __pyx_L0;
21126  __pyx_L1_error:;
21127  __Pyx_WriteUnraisable("View.MemoryView.broadcast_leading", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
21128  __pyx_L0:;
21129  __Pyx_TraceReturn(Py_None, 1);
21130 }
21131 
21132 /* "View.MemoryView":1359
21133  *
21134  * @cname('__pyx_memoryview_refcount_copying')
21135  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
21136  * int ndim, bint inc) nogil:
21137  *
21138  */
21139 
21140 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
21141  __Pyx_TraceDeclarations
21142  int __pyx_t_1;
21143  __Pyx_TraceCall("refcount_copying", __pyx_f[1], 1359, 1, __PYX_ERR(1, 1359, __pyx_L1_error));
21144 
21145  /* "View.MemoryView":1363
21146  *
21147  *
21148  * if dtype_is_object: # <<<<<<<<<<<<<<
21149  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
21150  * dst.strides, ndim, inc)
21151  */
21152  __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
21153  if (__pyx_t_1) {
21154 
21155  /* "View.MemoryView":1364
21156  *
21157  * if dtype_is_object:
21158  * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
21159  * dst.strides, ndim, inc)
21160  *
21161  */
21162  __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
21163 
21164  /* "View.MemoryView":1363
21165  *
21166  *
21167  * if dtype_is_object: # <<<<<<<<<<<<<<
21168  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
21169  * dst.strides, ndim, inc)
21170  */
21171  }
21172 
21173  /* "View.MemoryView":1359
21174  *
21175  * @cname('__pyx_memoryview_refcount_copying')
21176  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
21177  * int ndim, bint inc) nogil:
21178  *
21179  */
21180 
21181  /* function exit code */
21182  goto __pyx_L0;
21183  __pyx_L1_error:;
21184  __Pyx_WriteUnraisable("View.MemoryView.refcount_copying", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
21185  __pyx_L0:;
21186  __Pyx_TraceReturn(Py_None, 1);
21187 }
21188 
21189 /* "View.MemoryView":1368
21190  *
21191  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
21192  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
21193  * Py_ssize_t *strides, int ndim,
21194  * bint inc) with gil:
21195  */
21196 
21197 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
21198  __Pyx_TraceDeclarations
21199  __Pyx_RefNannyDeclarations
21200  #ifdef WITH_THREAD
21201  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
21202  #endif
21203  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
21204  __Pyx_TraceCall("refcount_objects_in_slice_with_gil", __pyx_f[1], 1368, 0, __PYX_ERR(1, 1368, __pyx_L1_error));
21205 
21206  /* "View.MemoryView":1371
21207  * Py_ssize_t *strides, int ndim,
21208  * bint inc) with gil:
21209  * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
21210  *
21211  * @cname('__pyx_memoryview_refcount_objects_in_slice')
21212  */
21213  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
21214 
21215  /* "View.MemoryView":1368
21216  *
21217  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
21218  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
21219  * Py_ssize_t *strides, int ndim,
21220  * bint inc) with gil:
21221  */
21222 
21223  /* function exit code */
21224  goto __pyx_L0;
21225  __pyx_L1_error:;
21226  __Pyx_WriteUnraisable("View.MemoryView.refcount_objects_in_slice_with_gil", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
21227  __pyx_L0:;
21228  __Pyx_TraceReturn(Py_None, 0);
21229  __Pyx_RefNannyFinishContext();
21230  #ifdef WITH_THREAD
21231  __Pyx_PyGILState_Release(__pyx_gilstate_save);
21232  #endif
21233 }
21234 
21235 /* "View.MemoryView":1374
21236  *
21237  * @cname('__pyx_memoryview_refcount_objects_in_slice')
21238  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
21239  * Py_ssize_t *strides, int ndim, bint inc):
21240  * cdef Py_ssize_t i
21241  */
21242 
21243 static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
21244  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
21245  __Pyx_TraceDeclarations
21246  __Pyx_RefNannyDeclarations
21247  Py_ssize_t __pyx_t_1;
21248  Py_ssize_t __pyx_t_2;
21249  Py_ssize_t __pyx_t_3;
21250  int __pyx_t_4;
21251  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
21252  __Pyx_TraceCall("refcount_objects_in_slice", __pyx_f[1], 1374, 0, __PYX_ERR(1, 1374, __pyx_L1_error));
21253 
21254  /* "View.MemoryView":1378
21255  * cdef Py_ssize_t i
21256  *
21257  * for i in range(shape[0]): # <<<<<<<<<<<<<<
21258  * if ndim == 1:
21259  * if inc:
21260  */
21261  __pyx_t_1 = (__pyx_v_shape[0]);
21262  __pyx_t_2 = __pyx_t_1;
21263  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
21264  __pyx_v_i = __pyx_t_3;
21265 
21266  /* "View.MemoryView":1379
21267  *
21268  * for i in range(shape[0]):
21269  * if ndim == 1: # <<<<<<<<<<<<<<
21270  * if inc:
21271  * Py_INCREF((<PyObject **> data)[0])
21272  */
21273  __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
21274  if (__pyx_t_4) {
21275 
21276  /* "View.MemoryView":1380
21277  * for i in range(shape[0]):
21278  * if ndim == 1:
21279  * if inc: # <<<<<<<<<<<<<<
21280  * Py_INCREF((<PyObject **> data)[0])
21281  * else:
21282  */
21283  __pyx_t_4 = (__pyx_v_inc != 0);
21284  if (__pyx_t_4) {
21285 
21286  /* "View.MemoryView":1381
21287  * if ndim == 1:
21288  * if inc:
21289  * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
21290  * else:
21291  * Py_DECREF((<PyObject **> data)[0])
21292  */
21293  Py_INCREF((((PyObject **)__pyx_v_data)[0]));
21294 
21295  /* "View.MemoryView":1380
21296  * for i in range(shape[0]):
21297  * if ndim == 1:
21298  * if inc: # <<<<<<<<<<<<<<
21299  * Py_INCREF((<PyObject **> data)[0])
21300  * else:
21301  */
21302  goto __pyx_L6;
21303  }
21304 
21305  /* "View.MemoryView":1383
21306  * Py_INCREF((<PyObject **> data)[0])
21307  * else:
21308  * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
21309  * else:
21310  * refcount_objects_in_slice(data, shape + 1, strides + 1,
21311  */
21312  /*else*/ {
21313  Py_DECREF((((PyObject **)__pyx_v_data)[0]));
21314  }
21315  __pyx_L6:;
21316 
21317  /* "View.MemoryView":1379
21318  *
21319  * for i in range(shape[0]):
21320  * if ndim == 1: # <<<<<<<<<<<<<<
21321  * if inc:
21322  * Py_INCREF((<PyObject **> data)[0])
21323  */
21324  goto __pyx_L5;
21325  }
21326 
21327  /* "View.MemoryView":1385
21328  * Py_DECREF((<PyObject **> data)[0])
21329  * else:
21330  * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
21331  * ndim - 1, inc)
21332  *
21333  */
21334  /*else*/ {
21335 
21336  /* "View.MemoryView":1386
21337  * else:
21338  * refcount_objects_in_slice(data, shape + 1, strides + 1,
21339  * ndim - 1, inc) # <<<<<<<<<<<<<<
21340  *
21341  * data += strides[0]
21342  */
21343  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
21344  }
21345  __pyx_L5:;
21346 
21347  /* "View.MemoryView":1388
21348  * ndim - 1, inc)
21349  *
21350  * data += strides[0] # <<<<<<<<<<<<<<
21351  *
21352  *
21353  */
21354  __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
21355  }
21356 
21357  /* "View.MemoryView":1374
21358  *
21359  * @cname('__pyx_memoryview_refcount_objects_in_slice')
21360  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
21361  * Py_ssize_t *strides, int ndim, bint inc):
21362  * cdef Py_ssize_t i
21363  */
21364 
21365  /* function exit code */
21366  goto __pyx_L0;
21367  __pyx_L1_error:;
21368  __Pyx_WriteUnraisable("View.MemoryView.refcount_objects_in_slice", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
21369  __pyx_L0:;
21370  __Pyx_TraceReturn(Py_None, 0);
21371  __Pyx_RefNannyFinishContext();
21372 }
21373 
21374 /* "View.MemoryView":1394
21375  *
21376  * @cname('__pyx_memoryview_slice_assign_scalar')
21377  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
21378  * size_t itemsize, void *item,
21379  * bint dtype_is_object) nogil:
21380  */
21381 
21382 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
21383  __Pyx_TraceDeclarations
21384  __Pyx_TraceCall("slice_assign_scalar", __pyx_f[1], 1394, 1, __PYX_ERR(1, 1394, __pyx_L1_error));
21385 
21386  /* "View.MemoryView":1397
21387  * size_t itemsize, void *item,
21388  * bint dtype_is_object) nogil:
21389  * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
21390  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
21391  * itemsize, item)
21392  */
21393  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
21394 
21395  /* "View.MemoryView":1398
21396  * bint dtype_is_object) nogil:
21397  * refcount_copying(dst, dtype_is_object, ndim, False)
21398  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
21399  * itemsize, item)
21400  * refcount_copying(dst, dtype_is_object, ndim, True)
21401  */
21402  __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
21403 
21404  /* "View.MemoryView":1400
21405  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
21406  * itemsize, item)
21407  * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
21408  *
21409  *
21410  */
21411  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
21412 
21413  /* "View.MemoryView":1394
21414  *
21415  * @cname('__pyx_memoryview_slice_assign_scalar')
21416  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
21417  * size_t itemsize, void *item,
21418  * bint dtype_is_object) nogil:
21419  */
21420 
21421  /* function exit code */
21422  goto __pyx_L0;
21423  __pyx_L1_error:;
21424  __Pyx_WriteUnraisable("View.MemoryView.slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
21425  __pyx_L0:;
21426  __Pyx_TraceReturn(Py_None, 1);
21427 }
21428 
21429 /* "View.MemoryView":1404
21430  *
21431  * @cname('__pyx_memoryview__slice_assign_scalar')
21432  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
21433  * Py_ssize_t *strides, int ndim,
21434  * size_t itemsize, void *item) nogil:
21435  */
21436 
21437 static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
21438  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
21439  Py_ssize_t __pyx_v_stride;
21440  Py_ssize_t __pyx_v_extent;
21441  __Pyx_TraceDeclarations
21442  int __pyx_t_1;
21443  Py_ssize_t __pyx_t_2;
21444  Py_ssize_t __pyx_t_3;
21445  Py_ssize_t __pyx_t_4;
21446  __Pyx_TraceCall("_slice_assign_scalar", __pyx_f[1], 1404, 1, __PYX_ERR(1, 1404, __pyx_L1_error));
21447 
21448  /* "View.MemoryView":1408
21449  * size_t itemsize, void *item) nogil:
21450  * cdef Py_ssize_t i
21451  * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
21452  * cdef Py_ssize_t extent = shape[0]
21453  *
21454  */
21455  __pyx_v_stride = (__pyx_v_strides[0]);
21456 
21457  /* "View.MemoryView":1409
21458  * cdef Py_ssize_t i
21459  * cdef Py_ssize_t stride = strides[0]
21460  * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
21461  *
21462  * if ndim == 1:
21463  */
21464  __pyx_v_extent = (__pyx_v_shape[0]);
21465 
21466  /* "View.MemoryView":1411
21467  * cdef Py_ssize_t extent = shape[0]
21468  *
21469  * if ndim == 1: # <<<<<<<<<<<<<<
21470  * for i in range(extent):
21471  * memcpy(data, item, itemsize)
21472  */
21473  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
21474  if (__pyx_t_1) {
21475 
21476  /* "View.MemoryView":1412
21477  *
21478  * if ndim == 1:
21479  * for i in range(extent): # <<<<<<<<<<<<<<
21480  * memcpy(data, item, itemsize)
21481  * data += stride
21482  */
21483  __pyx_t_2 = __pyx_v_extent;
21484  __pyx_t_3 = __pyx_t_2;
21485  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
21486  __pyx_v_i = __pyx_t_4;
21487 
21488  /* "View.MemoryView":1413
21489  * if ndim == 1:
21490  * for i in range(extent):
21491  * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
21492  * data += stride
21493  * else:
21494  */
21495  (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
21496 
21497  /* "View.MemoryView":1414
21498  * for i in range(extent):
21499  * memcpy(data, item, itemsize)
21500  * data += stride # <<<<<<<<<<<<<<
21501  * else:
21502  * for i in range(extent):
21503  */
21504  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
21505  }
21506 
21507  /* "View.MemoryView":1411
21508  * cdef Py_ssize_t extent = shape[0]
21509  *
21510  * if ndim == 1: # <<<<<<<<<<<<<<
21511  * for i in range(extent):
21512  * memcpy(data, item, itemsize)
21513  */
21514  goto __pyx_L3;
21515  }
21516 
21517  /* "View.MemoryView":1416
21518  * data += stride
21519  * else:
21520  * for i in range(extent): # <<<<<<<<<<<<<<
21521  * _slice_assign_scalar(data, shape + 1, strides + 1,
21522  * ndim - 1, itemsize, item)
21523  */
21524  /*else*/ {
21525  __pyx_t_2 = __pyx_v_extent;
21526  __pyx_t_3 = __pyx_t_2;
21527  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
21528  __pyx_v_i = __pyx_t_4;
21529 
21530  /* "View.MemoryView":1417
21531  * else:
21532  * for i in range(extent):
21533  * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
21534  * ndim - 1, itemsize, item)
21535  * data += stride
21536  */
21537  __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
21538 
21539  /* "View.MemoryView":1419
21540  * _slice_assign_scalar(data, shape + 1, strides + 1,
21541  * ndim - 1, itemsize, item)
21542  * data += stride # <<<<<<<<<<<<<<
21543  *
21544  *
21545  */
21546  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
21547  }
21548  }
21549  __pyx_L3:;
21550 
21551  /* "View.MemoryView":1404
21552  *
21553  * @cname('__pyx_memoryview__slice_assign_scalar')
21554  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
21555  * Py_ssize_t *strides, int ndim,
21556  * size_t itemsize, void *item) nogil:
21557  */
21558 
21559  /* function exit code */
21560  goto __pyx_L0;
21561  __pyx_L1_error:;
21562  __Pyx_WriteUnraisable("View.MemoryView._slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
21563  __pyx_L0:;
21564  __Pyx_TraceReturn(Py_None, 1);
21565 }
21566 
21567 /* "(tree fragment)":1
21568  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
21569  * cdef object __pyx_PickleError
21570  * cdef object __pyx_result
21571  */
21572 
21573 /* Python wrapper */
21574 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
21575 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
21576 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
21577  PyObject *__pyx_v___pyx_type = 0;
21578  long __pyx_v___pyx_checksum;
21579  PyObject *__pyx_v___pyx_state = 0;
21580  PyObject *__pyx_r = 0;
21581  __Pyx_RefNannyDeclarations
21582  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
21583  {
21584  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
21585  PyObject* values[3] = {0,0,0};
21586  if (unlikely(__pyx_kwds)) {
21587  Py_ssize_t kw_args;
21588  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
21589  switch (pos_args) {
21590  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
21591  CYTHON_FALLTHROUGH;
21592  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
21593  CYTHON_FALLTHROUGH;
21594  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21595  CYTHON_FALLTHROUGH;
21596  case 0: break;
21597  default: goto __pyx_L5_argtuple_error;
21598  }
21599  kw_args = PyDict_Size(__pyx_kwds);
21600  switch (pos_args) {
21601  case 0:
21602  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
21603  else goto __pyx_L5_argtuple_error;
21604  CYTHON_FALLTHROUGH;
21605  case 1:
21606  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
21607  else {
21608  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
21609  }
21610  CYTHON_FALLTHROUGH;
21611  case 2:
21612  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
21613  else {
21614  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
21615  }
21616  }
21617  if (unlikely(kw_args > 0)) {
21618  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
21619  }
21620  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
21621  goto __pyx_L5_argtuple_error;
21622  } else {
21623  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21624  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
21625  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
21626  }
21627  __pyx_v___pyx_type = values[0];
21628  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
21629  __pyx_v___pyx_state = values[2];
21630  }
21631  goto __pyx_L4_argument_unpacking_done;
21632  __pyx_L5_argtuple_error:;
21633  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
21634  __pyx_L3_error:;
21635  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21636  __Pyx_RefNannyFinishContext();
21637  return NULL;
21638  __pyx_L4_argument_unpacking_done:;
21639  __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
21640 
21641  /* function exit code */
21642  __Pyx_RefNannyFinishContext();
21643  return __pyx_r;
21644 }
21645 
21646 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
21647  PyObject *__pyx_v___pyx_PickleError = 0;
21648  PyObject *__pyx_v___pyx_result = 0;
21649  PyObject *__pyx_r = NULL;
21650  __Pyx_TraceDeclarations
21651  __Pyx_RefNannyDeclarations
21652  int __pyx_t_1;
21653  PyObject *__pyx_t_2 = NULL;
21654  PyObject *__pyx_t_3 = NULL;
21655  PyObject *__pyx_t_4 = NULL;
21656  PyObject *__pyx_t_5 = NULL;
21657  int __pyx_t_6;
21658  __Pyx_TraceFrameInit(__pyx_codeobj__39)
21659  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
21660  __Pyx_TraceCall("__pyx_unpickle_Enum", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
21661 
21662  /* "(tree fragment)":4
21663  * cdef object __pyx_PickleError
21664  * cdef object __pyx_result
21665  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
21666  * from pickle import PickleError as __pyx_PickleError
21667  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21668  */
21669  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
21670  if (__pyx_t_1) {
21671 
21672  /* "(tree fragment)":5
21673  * cdef object __pyx_result
21674  * if __pyx_checksum != 0xb068931:
21675  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
21676  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21677  * __pyx_result = Enum.__new__(__pyx_type)
21678  */
21679  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
21680  __Pyx_GOTREF(__pyx_t_2);
21681  __Pyx_INCREF(__pyx_n_s_PickleError);
21682  __Pyx_GIVEREF(__pyx_n_s_PickleError);
21683  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
21684  __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
21685  __Pyx_GOTREF(__pyx_t_3);
21686  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21687  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
21688  __Pyx_GOTREF(__pyx_t_2);
21689  __Pyx_INCREF(__pyx_t_2);
21690  __pyx_v___pyx_PickleError = __pyx_t_2;
21691  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21692  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21693 
21694  /* "(tree fragment)":6
21695  * if __pyx_checksum != 0xb068931:
21696  * from pickle import PickleError as __pyx_PickleError
21697  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
21698  * __pyx_result = Enum.__new__(__pyx_type)
21699  * if __pyx_state is not None:
21700  */
21701  __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
21702  __Pyx_GOTREF(__pyx_t_2);
21703  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
21704  __Pyx_GOTREF(__pyx_t_4);
21705  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21706  __Pyx_INCREF(__pyx_v___pyx_PickleError);
21707  __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
21708  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
21709  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
21710  if (likely(__pyx_t_5)) {
21711  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
21712  __Pyx_INCREF(__pyx_t_5);
21713  __Pyx_INCREF(function);
21714  __Pyx_DECREF_SET(__pyx_t_2, function);
21715  }
21716  }
21717  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
21718  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21719  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21720  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
21721  __Pyx_GOTREF(__pyx_t_3);
21722  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21723  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21724  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21725  __PYX_ERR(1, 6, __pyx_L1_error)
21726 
21727  /* "(tree fragment)":4
21728  * cdef object __pyx_PickleError
21729  * cdef object __pyx_result
21730  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
21731  * from pickle import PickleError as __pyx_PickleError
21732  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21733  */
21734  }
21735 
21736  /* "(tree fragment)":7
21737  * from pickle import PickleError as __pyx_PickleError
21738  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21739  * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
21740  * if __pyx_state is not None:
21741  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21742  */
21743  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
21744  __Pyx_GOTREF(__pyx_t_2);
21745  __pyx_t_4 = NULL;
21746  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
21747  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
21748  if (likely(__pyx_t_4)) {
21749  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
21750  __Pyx_INCREF(__pyx_t_4);
21751  __Pyx_INCREF(function);
21752  __Pyx_DECREF_SET(__pyx_t_2, function);
21753  }
21754  }
21755  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
21756  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
21757  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
21758  __Pyx_GOTREF(__pyx_t_3);
21759  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21760  __pyx_v___pyx_result = __pyx_t_3;
21761  __pyx_t_3 = 0;
21762 
21763  /* "(tree fragment)":8
21764  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21765  * __pyx_result = Enum.__new__(__pyx_type)
21766  * if __pyx_state is not None: # <<<<<<<<<<<<<<
21767  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21768  * return __pyx_result
21769  */
21770  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
21771  __pyx_t_6 = (__pyx_t_1 != 0);
21772  if (__pyx_t_6) {
21773 
21774  /* "(tree fragment)":9
21775  * __pyx_result = Enum.__new__(__pyx_type)
21776  * if __pyx_state is not None:
21777  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
21778  * return __pyx_result
21779  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21780  */
21781  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
21782  __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
21783  __Pyx_GOTREF(__pyx_t_3);
21784  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21785 
21786  /* "(tree fragment)":8
21787  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21788  * __pyx_result = Enum.__new__(__pyx_type)
21789  * if __pyx_state is not None: # <<<<<<<<<<<<<<
21790  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21791  * return __pyx_result
21792  */
21793  }
21794 
21795  /* "(tree fragment)":10
21796  * if __pyx_state is not None:
21797  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21798  * return __pyx_result # <<<<<<<<<<<<<<
21799  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21800  * __pyx_result.name = __pyx_state[0]
21801  */
21802  __Pyx_XDECREF(__pyx_r);
21803  __Pyx_INCREF(__pyx_v___pyx_result);
21804  __pyx_r = __pyx_v___pyx_result;
21805  goto __pyx_L0;
21806 
21807  /* "(tree fragment)":1
21808  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
21809  * cdef object __pyx_PickleError
21810  * cdef object __pyx_result
21811  */
21812 
21813  /* function exit code */
21814  __pyx_L1_error:;
21815  __Pyx_XDECREF(__pyx_t_2);
21816  __Pyx_XDECREF(__pyx_t_3);
21817  __Pyx_XDECREF(__pyx_t_4);
21818  __Pyx_XDECREF(__pyx_t_5);
21819  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21820  __pyx_r = NULL;
21821  __pyx_L0:;
21822  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
21823  __Pyx_XDECREF(__pyx_v___pyx_result);
21824  __Pyx_XGIVEREF(__pyx_r);
21825  __Pyx_TraceReturn(__pyx_r, 0);
21826  __Pyx_RefNannyFinishContext();
21827  return __pyx_r;
21828 }
21829 
21830 /* "(tree fragment)":11
21831  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21832  * return __pyx_result
21833  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
21834  * __pyx_result.name = __pyx_state[0]
21835  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21836  */
21837 
21838 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
21839  PyObject *__pyx_r = NULL;
21840  __Pyx_TraceDeclarations
21841  __Pyx_RefNannyDeclarations
21842  PyObject *__pyx_t_1 = NULL;
21843  int __pyx_t_2;
21844  Py_ssize_t __pyx_t_3;
21845  int __pyx_t_4;
21846  int __pyx_t_5;
21847  PyObject *__pyx_t_6 = NULL;
21848  PyObject *__pyx_t_7 = NULL;
21849  PyObject *__pyx_t_8 = NULL;
21850  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
21851  __Pyx_TraceCall("__pyx_unpickle_Enum__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error));
21852 
21853  /* "(tree fragment)":12
21854  * return __pyx_result
21855  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21856  * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
21857  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21858  * __pyx_result.__dict__.update(__pyx_state[1])
21859  */
21860  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21861  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21862  __PYX_ERR(1, 12, __pyx_L1_error)
21863  }
21864  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
21865  __Pyx_GOTREF(__pyx_t_1);
21866  __Pyx_GIVEREF(__pyx_t_1);
21867  __Pyx_GOTREF(__pyx_v___pyx_result->name);
21868  __Pyx_DECREF(__pyx_v___pyx_result->name);
21869  __pyx_v___pyx_result->name = __pyx_t_1;
21870  __pyx_t_1 = 0;
21871 
21872  /* "(tree fragment)":13
21873  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21874  * __pyx_result.name = __pyx_state[0]
21875  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
21876  * __pyx_result.__dict__.update(__pyx_state[1])
21877  */
21878  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21879  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
21880  __PYX_ERR(1, 13, __pyx_L1_error)
21881  }
21882  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
21883  __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
21884  if (__pyx_t_4) {
21885  } else {
21886  __pyx_t_2 = __pyx_t_4;
21887  goto __pyx_L4_bool_binop_done;
21888  }
21889  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
21890  __pyx_t_5 = (__pyx_t_4 != 0);
21891  __pyx_t_2 = __pyx_t_5;
21892  __pyx_L4_bool_binop_done:;
21893  if (__pyx_t_2) {
21894 
21895  /* "(tree fragment)":14
21896  * __pyx_result.name = __pyx_state[0]
21897  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21898  * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
21899  */
21900  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
21901  __Pyx_GOTREF(__pyx_t_6);
21902  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
21903  __Pyx_GOTREF(__pyx_t_7);
21904  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21905  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21906  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21907  __PYX_ERR(1, 14, __pyx_L1_error)
21908  }
21909  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
21910  __Pyx_GOTREF(__pyx_t_6);
21911  __pyx_t_8 = NULL;
21912  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
21913  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
21914  if (likely(__pyx_t_8)) {
21915  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
21916  __Pyx_INCREF(__pyx_t_8);
21917  __Pyx_INCREF(function);
21918  __Pyx_DECREF_SET(__pyx_t_7, function);
21919  }
21920  }
21921  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
21922  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
21923  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21924  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
21925  __Pyx_GOTREF(__pyx_t_1);
21926  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21927  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21928 
21929  /* "(tree fragment)":13
21930  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21931  * __pyx_result.name = __pyx_state[0]
21932  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
21933  * __pyx_result.__dict__.update(__pyx_state[1])
21934  */
21935  }
21936 
21937  /* "(tree fragment)":11
21938  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21939  * return __pyx_result
21940  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
21941  * __pyx_result.name = __pyx_state[0]
21942  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21943  */
21944 
21945  /* function exit code */
21946  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21947  goto __pyx_L0;
21948  __pyx_L1_error:;
21949  __Pyx_XDECREF(__pyx_t_1);
21950  __Pyx_XDECREF(__pyx_t_6);
21951  __Pyx_XDECREF(__pyx_t_7);
21952  __Pyx_XDECREF(__pyx_t_8);
21953  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
21954  __pyx_r = 0;
21955  __pyx_L0:;
21956  __Pyx_XGIVEREF(__pyx_r);
21957  __Pyx_TraceReturn(__pyx_r, 0);
21958  __Pyx_RefNannyFinishContext();
21959  return __pyx_r;
21960 }
21961 
21962 static PyObject *__pyx_tp_new_18BoundaryConditions_BC_Base(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21963  struct __pyx_obj_18BoundaryConditions_BC_Base *p;
21964  PyObject *o;
21965  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21966  o = (*t->tp_alloc)(t, 0);
21967  } else {
21968  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21969  }
21970  if (unlikely(!o)) return 0;
21971  p = ((struct __pyx_obj_18BoundaryConditions_BC_Base *)o);
21972  p->Shape = Py_None; Py_INCREF(Py_None);
21973  p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
21974  p->BC_type = ((PyObject*)Py_None); Py_INCREF(Py_None);
21975  p->ct = Py_None; Py_INCREF(Py_None);
21976  p->_b_or.data = NULL;
21977  p->_b_or.memview = NULL;
21978  return o;
21979 }
21980 
21981 static void __pyx_tp_dealloc_18BoundaryConditions_BC_Base(PyObject *o) {
21982  struct __pyx_obj_18BoundaryConditions_BC_Base *p = (struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
21983  #if CYTHON_USE_TP_FINALIZE
21984  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21985  if (PyObject_CallFinalizerFromDealloc(o)) return;
21986  }
21987  #endif
21988  PyObject_GC_UnTrack(o);
21989  Py_CLEAR(p->Shape);
21990  Py_CLEAR(p->name);
21991  Py_CLEAR(p->BC_type);
21992  Py_CLEAR(p->ct);
21993  __PYX_XDEC_MEMVIEW(&p->_b_or, 1);
21994  (*Py_TYPE(o)->tp_free)(o);
21995 }
21996 
21997 static int __pyx_tp_traverse_18BoundaryConditions_BC_Base(PyObject *o, visitproc v, void *a) {
21998  int e;
21999  struct __pyx_obj_18BoundaryConditions_BC_Base *p = (struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
22000  if (p->Shape) {
22001  e = (*v)(p->Shape, a); if (e) return e;
22002  }
22003  if (p->ct) {
22004  e = (*v)(p->ct, a); if (e) return e;
22005  }
22006  return 0;
22007 }
22008 
22009 static int __pyx_tp_clear_18BoundaryConditions_BC_Base(PyObject *o) {
22010  PyObject* tmp;
22011  struct __pyx_obj_18BoundaryConditions_BC_Base *p = (struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
22012  tmp = ((PyObject*)p->Shape);
22013  p->Shape = Py_None; Py_INCREF(Py_None);
22014  Py_XDECREF(tmp);
22015  tmp = ((PyObject*)p->ct);
22016  p->ct = Py_None; Py_INCREF(Py_None);
22017  Py_XDECREF(tmp);
22018  return 0;
22019 }
22020 
22021 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_nd(PyObject *o, CYTHON_UNUSED void *x) {
22022  return __pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(o);
22023 }
22024 
22025 static int __pyx_setprop_18BoundaryConditions_7BC_Base_nd(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
22026  if (v) {
22027  return __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(o, v);
22028  }
22029  else {
22030  PyErr_SetString(PyExc_NotImplementedError, "__del__");
22031  return -1;
22032  }
22033 }
22034 
22035 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_Shape(PyObject *o, CYTHON_UNUSED void *x) {
22036  return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(o);
22037 }
22038 
22039 static int __pyx_setprop_18BoundaryConditions_7BC_Base_Shape(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
22040  if (v) {
22041  return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(o, v);
22042  }
22043  else {
22044  return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(o);
22045  }
22046 }
22047 
22048 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_name(PyObject *o, CYTHON_UNUSED void *x) {
22049  return __pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(o);
22050 }
22051 
22052 static int __pyx_setprop_18BoundaryConditions_7BC_Base_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
22053  if (v) {
22054  return __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(o, v);
22055  }
22056  else {
22057  return __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(o);
22058  }
22059 }
22060 
22061 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_BC_type(PyObject *o, CYTHON_UNUSED void *x) {
22062  return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(o);
22063 }
22064 
22065 static int __pyx_setprop_18BoundaryConditions_7BC_Base_BC_type(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
22066  if (v) {
22067  return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(o, v);
22068  }
22069  else {
22070  return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(o);
22071  }
22072 }
22073 
22074 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_ct(PyObject *o, CYTHON_UNUSED void *x) {
22075  return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(o);
22076 }
22077 
22078 static int __pyx_setprop_18BoundaryConditions_7BC_Base_ct(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
22079  if (v) {
22080  return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(o, v);
22081  }
22082  else {
22083  return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(o);
22084  }
22085 }
22086 
22087 static PyMethodDef __pyx_methods_18BoundaryConditions_BC_Base[] = {
22088  {"getContext", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_7BC_Base_3getContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_7BC_Base_2getContext},
22089  {"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__, METH_NOARGS, __pyx_doc_18BoundaryConditions_7BC_Base_4__reduce_cython__},
22090  {"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__, METH_O, __pyx_doc_18BoundaryConditions_7BC_Base_6__setstate_cython__},
22091  {0, 0, 0, 0}
22092 };
22093 
22094 static struct PyGetSetDef __pyx_getsets_18BoundaryConditions_BC_Base[] = {
22095  {(char *)"nd", __pyx_getprop_18BoundaryConditions_7BC_Base_nd, __pyx_setprop_18BoundaryConditions_7BC_Base_nd, (char *)"nd: 'int'", 0},
22096  {(char *)"Shape", __pyx_getprop_18BoundaryConditions_7BC_Base_Shape, __pyx_setprop_18BoundaryConditions_7BC_Base_Shape, (char *)"Shape: object", 0},
22097  {(char *)"name", __pyx_getprop_18BoundaryConditions_7BC_Base_name, __pyx_setprop_18BoundaryConditions_7BC_Base_name, (char *)"name: str", 0},
22098  {(char *)"BC_type", __pyx_getprop_18BoundaryConditions_7BC_Base_BC_type, __pyx_setprop_18BoundaryConditions_7BC_Base_BC_type, (char *)"BC_type: str", 0},
22099  {(char *)"ct", __pyx_getprop_18BoundaryConditions_7BC_Base_ct, __pyx_setprop_18BoundaryConditions_7BC_Base_ct, (char *)"ct: object", 0},
22100  {0, 0, 0, 0, 0}
22101 };
22102 
22103 static PyTypeObject __pyx_type_18BoundaryConditions_BC_Base = {
22104  PyVarObject_HEAD_INIT(0, 0)
22105  "BoundaryConditions.BC_Base", /*tp_name*/
22106  sizeof(struct __pyx_obj_18BoundaryConditions_BC_Base), /*tp_basicsize*/
22107  0, /*tp_itemsize*/
22108  __pyx_tp_dealloc_18BoundaryConditions_BC_Base, /*tp_dealloc*/
22109  0, /*tp_print*/
22110  0, /*tp_getattr*/
22111  0, /*tp_setattr*/
22112  #if PY_MAJOR_VERSION < 3
22113  0, /*tp_compare*/
22114  #endif
22115  #if PY_MAJOR_VERSION >= 3
22116  0, /*tp_as_async*/
22117  #endif
22118  0, /*tp_repr*/
22119  0, /*tp_as_number*/
22120  0, /*tp_as_sequence*/
22121  0, /*tp_as_mapping*/
22122  0, /*tp_hash*/
22123  0, /*tp_call*/
22124  0, /*tp_str*/
22125  0, /*tp_getattro*/
22126  0, /*tp_setattro*/
22127  0, /*tp_as_buffer*/
22128  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22129  "BC_Base(shape=None, name=None, b_or=None, b_i=0, nd=None)\n\n Generic class regrouping boundary conditions\n ", /*tp_doc*/
22130  __pyx_tp_traverse_18BoundaryConditions_BC_Base, /*tp_traverse*/
22131  __pyx_tp_clear_18BoundaryConditions_BC_Base, /*tp_clear*/
22132  0, /*tp_richcompare*/
22133  0, /*tp_weaklistoffset*/
22134  0, /*tp_iter*/
22135  0, /*tp_iternext*/
22136  __pyx_methods_18BoundaryConditions_BC_Base, /*tp_methods*/
22137  0, /*tp_members*/
22138  __pyx_getsets_18BoundaryConditions_BC_Base, /*tp_getset*/
22139  0, /*tp_base*/
22140  0, /*tp_dict*/
22141  0, /*tp_descr_get*/
22142  0, /*tp_descr_set*/
22143  0, /*tp_dictoffset*/
22144  __pyx_pw_18BoundaryConditions_7BC_Base_1__init__, /*tp_init*/
22145  0, /*tp_alloc*/
22146  __pyx_tp_new_18BoundaryConditions_BC_Base, /*tp_new*/
22147  0, /*tp_free*/
22148  0, /*tp_is_gc*/
22149  0, /*tp_bases*/
22150  0, /*tp_mro*/
22151  0, /*tp_cache*/
22152  0, /*tp_subclasses*/
22153  0, /*tp_weaklist*/
22154  0, /*tp_del*/
22155  0, /*tp_version_tag*/
22156  #if PY_VERSION_HEX >= 0x030400a1
22157  0, /*tp_finalize*/
22158  #endif
22159 };
22160 static struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition __pyx_vtable_18BoundaryConditions_BoundaryCondition;
22161 
22162 static PyObject *__pyx_tp_new_18BoundaryConditions_BoundaryCondition(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
22163  struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p;
22164  PyObject *o;
22165  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22166  o = (*t->tp_alloc)(t, 0);
22167  } else {
22168  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22169  }
22170  if (unlikely(!o)) return 0;
22171  p = ((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o);
22172  p->__pyx_vtab = __pyx_vtabptr_18BoundaryConditions_BoundaryCondition;
22173  p->uOfXT = Py_None; Py_INCREF(Py_None);
22174  return o;
22175 }
22176 
22177 static void __pyx_tp_dealloc_18BoundaryConditions_BoundaryCondition(PyObject *o) {
22178  struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
22179  #if CYTHON_USE_TP_FINALIZE
22180  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22181  if (PyObject_CallFinalizerFromDealloc(o)) return;
22182  }
22183  #endif
22184  PyObject_GC_UnTrack(o);
22185  Py_CLEAR(p->uOfXT);
22186  (*Py_TYPE(o)->tp_free)(o);
22187 }
22188 
22189 static int __pyx_tp_traverse_18BoundaryConditions_BoundaryCondition(PyObject *o, visitproc v, void *a) {
22190  int e;
22191  struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
22192  if (p->uOfXT) {
22193  e = (*v)(p->uOfXT, a); if (e) return e;
22194  }
22195  return 0;
22196 }
22197 
22198 static int __pyx_tp_clear_18BoundaryConditions_BoundaryCondition(PyObject *o) {
22199  PyObject* tmp;
22200  struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
22201  tmp = ((PyObject*)p->uOfXT);
22202  p->uOfXT = Py_None; Py_INCREF(Py_None);
22203  Py_XDECREF(tmp);
22204  return 0;
22205 }
22206 
22207 static PyObject *__pyx_getprop_18BoundaryConditions_17BoundaryCondition_uOfXT(PyObject *o, CYTHON_UNUSED void *x) {
22208  return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(o);
22209 }
22210 
22211 static int __pyx_setprop_18BoundaryConditions_17BoundaryCondition_uOfXT(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
22212  if (v) {
22213  return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(o, v);
22214  }
22215  else {
22216  return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(o);
22217  }
22218 }
22219 
22220 static PyMethodDef __pyx_methods_18BoundaryConditions_BoundaryCondition[] = {
22221  {"init_cython", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_2init_cython},
22222  {"setConstantBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC},
22223  {"setLinearBC", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_8setLinearBC},
22224  {"setLinearRamp", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_10setLinearRamp},
22225  {"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__},
22226  {"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__},
22227  {0, 0, 0, 0}
22228 };
22229 
22230 static struct PyGetSetDef __pyx_getsets_18BoundaryConditions_BoundaryCondition[] = {
22231  {(char *)"uOfXT", __pyx_getprop_18BoundaryConditions_17BoundaryCondition_uOfXT, __pyx_setprop_18BoundaryConditions_17BoundaryCondition_uOfXT, (char *)"uOfXT: object", 0},
22232  {0, 0, 0, 0, 0}
22233 };
22234 
22235 static PyTypeObject __pyx_type_18BoundaryConditions_BoundaryCondition = {
22236  PyVarObject_HEAD_INIT(0, 0)
22237  "BoundaryConditions.BoundaryCondition", /*tp_name*/
22238  sizeof(struct __pyx_obj_18BoundaryConditions_BoundaryCondition), /*tp_basicsize*/
22239  0, /*tp_itemsize*/
22240  __pyx_tp_dealloc_18BoundaryConditions_BoundaryCondition, /*tp_dealloc*/
22241  0, /*tp_print*/
22242  0, /*tp_getattr*/
22243  0, /*tp_setattr*/
22244  #if PY_MAJOR_VERSION < 3
22245  0, /*tp_compare*/
22246  #endif
22247  #if PY_MAJOR_VERSION >= 3
22248  0, /*tp_as_async*/
22249  #endif
22250  0, /*tp_repr*/
22251  0, /*tp_as_number*/
22252  0, /*tp_as_sequence*/
22253  0, /*tp_as_mapping*/
22254  0, /*tp_hash*/
22255  0, /*tp_call*/
22256  0, /*tp_str*/
22257  0, /*tp_getattro*/
22258  0, /*tp_setattro*/
22259  0, /*tp_as_buffer*/
22260  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22261  "BoundaryCondition()\n\n Boundary condition class\n\n Attributes\n ----------\n uOfXT: func or None\n boundary condition function of x (array_like) and t (float) or None for\n no boundary condition\n ", /*tp_doc*/
22262  __pyx_tp_traverse_18BoundaryConditions_BoundaryCondition, /*tp_traverse*/
22263  __pyx_tp_clear_18BoundaryConditions_BoundaryCondition, /*tp_clear*/
22264  0, /*tp_richcompare*/
22265  0, /*tp_weaklistoffset*/
22266  0, /*tp_iter*/
22267  0, /*tp_iternext*/
22268  __pyx_methods_18BoundaryConditions_BoundaryCondition, /*tp_methods*/
22269  0, /*tp_members*/
22270  __pyx_getsets_18BoundaryConditions_BoundaryCondition, /*tp_getset*/
22271  0, /*tp_base*/
22272  0, /*tp_dict*/
22273  0, /*tp_descr_get*/
22274  0, /*tp_descr_set*/
22275  0, /*tp_dictoffset*/
22276  __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__, /*tp_init*/
22277  0, /*tp_alloc*/
22278  __pyx_tp_new_18BoundaryConditions_BoundaryCondition, /*tp_new*/
22279  0, /*tp_free*/
22280  0, /*tp_is_gc*/
22281  0, /*tp_bases*/
22282  0, /*tp_mro*/
22283  0, /*tp_cache*/
22284  0, /*tp_subclasses*/
22285  0, /*tp_weaklist*/
22286  0, /*tp_del*/
22287  0, /*tp_version_tag*/
22288  #if PY_VERSION_HEX >= 0x030400a1
22289  0, /*tp_finalize*/
22290  #endif
22291 };
22292 
22293 static struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[8];
22294 static int __pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC = 0;
22295 
22296 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
22297  PyObject *o;
22298  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC)))) {
22299  o = (PyObject*)__pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[--__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC];
22300  memset(o, 0, sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC));
22301  (void) PyObject_INIT(o, t);
22302  PyObject_GC_Track(o);
22303  } else {
22304  o = (*t->tp_alloc)(t, 0);
22305  if (unlikely(!o)) return 0;
22306  }
22307  return o;
22308 }
22309 
22310 static void __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o) {
22311  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
22312  PyObject_GC_UnTrack(o);
22313  Py_CLEAR(p->__pyx_v_value);
22314  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC)))) {
22315  __pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC++] = ((struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o);
22316  } else {
22317  (*Py_TYPE(o)->tp_free)(o);
22318  }
22319 }
22320 
22321 static int __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o, visitproc v, void *a) {
22322  int e;
22323  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
22324  if (p->__pyx_v_value) {
22325  e = (*v)(p->__pyx_v_value, a); if (e) return e;
22326  }
22327  return 0;
22328 }
22329 
22330 static int __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o) {
22331  PyObject* tmp;
22332  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
22333  tmp = ((PyObject*)p->__pyx_v_value);
22334  p->__pyx_v_value = Py_None; Py_INCREF(Py_None);
22335  Py_XDECREF(tmp);
22336  return 0;
22337 }
22338 
22339 static PyTypeObject __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC = {
22340  PyVarObject_HEAD_INIT(0, 0)
22341  "BoundaryConditions.__pyx_scope_struct__setConstantBC", /*tp_name*/
22342  sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC), /*tp_basicsize*/
22343  0, /*tp_itemsize*/
22344  __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct__setConstantBC, /*tp_dealloc*/
22345  0, /*tp_print*/
22346  0, /*tp_getattr*/
22347  0, /*tp_setattr*/
22348  #if PY_MAJOR_VERSION < 3
22349  0, /*tp_compare*/
22350  #endif
22351  #if PY_MAJOR_VERSION >= 3
22352  0, /*tp_as_async*/
22353  #endif
22354  0, /*tp_repr*/
22355  0, /*tp_as_number*/
22356  0, /*tp_as_sequence*/
22357  0, /*tp_as_mapping*/
22358  0, /*tp_hash*/
22359  0, /*tp_call*/
22360  0, /*tp_str*/
22361  0, /*tp_getattro*/
22362  0, /*tp_setattro*/
22363  0, /*tp_as_buffer*/
22364  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22365  0, /*tp_doc*/
22366  __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct__setConstantBC, /*tp_traverse*/
22367  __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct__setConstantBC, /*tp_clear*/
22368  0, /*tp_richcompare*/
22369  0, /*tp_weaklistoffset*/
22370  0, /*tp_iter*/
22371  0, /*tp_iternext*/
22372  0, /*tp_methods*/
22373  0, /*tp_members*/
22374  0, /*tp_getset*/
22375  0, /*tp_base*/
22376  0, /*tp_dict*/
22377  0, /*tp_descr_get*/
22378  0, /*tp_descr_set*/
22379  0, /*tp_dictoffset*/
22380  0, /*tp_init*/
22381  0, /*tp_alloc*/
22382  __pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC, /*tp_new*/
22383  0, /*tp_free*/
22384  0, /*tp_is_gc*/
22385  0, /*tp_bases*/
22386  0, /*tp_mro*/
22387  0, /*tp_cache*/
22388  0, /*tp_subclasses*/
22389  0, /*tp_weaklist*/
22390  0, /*tp_del*/
22391  0, /*tp_version_tag*/
22392  #if PY_VERSION_HEX >= 0x030400a1
22393  0, /*tp_finalize*/
22394  #endif
22395 };
22396 
22397 static struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[8];
22398 static int __pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = 0;
22399 
22400 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
22401  PyObject *o;
22402  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC)))) {
22403  o = (PyObject*)__pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[--__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC];
22404  memset(o, 0, sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC));
22405  (void) PyObject_INIT(o, t);
22406  PyObject_GC_Track(o);
22407  } else {
22408  o = (*t->tp_alloc)(t, 0);
22409  if (unlikely(!o)) return 0;
22410  }
22411  return o;
22412 }
22413 
22414 static void __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o) {
22415  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
22416  PyObject_GC_UnTrack(o);
22417  Py_CLEAR(p->__pyx_v_a);
22418  Py_CLEAR(p->__pyx_v_a0);
22419  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC)))) {
22420  __pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC++] = ((struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o);
22421  } else {
22422  (*Py_TYPE(o)->tp_free)(o);
22423  }
22424 }
22425 
22426 static int __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o, visitproc v, void *a) {
22427  int e;
22428  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
22429  if (p->__pyx_v_a) {
22430  e = (*v)(p->__pyx_v_a, a); if (e) return e;
22431  }
22432  if (p->__pyx_v_a0) {
22433  e = (*v)(p->__pyx_v_a0, a); if (e) return e;
22434  }
22435  return 0;
22436 }
22437 
22438 static int __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o) {
22439  PyObject* tmp;
22440  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
22441  tmp = ((PyObject*)p->__pyx_v_a);
22442  p->__pyx_v_a = Py_None; Py_INCREF(Py_None);
22443  Py_XDECREF(tmp);
22444  tmp = ((PyObject*)p->__pyx_v_a0);
22445  p->__pyx_v_a0 = Py_None; Py_INCREF(Py_None);
22446  Py_XDECREF(tmp);
22447  return 0;
22448 }
22449 
22450 static PyTypeObject __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = {
22451  PyVarObject_HEAD_INIT(0, 0)
22452  "BoundaryConditions.__pyx_scope_struct_1_setLinearBC", /*tp_name*/
22453  sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC), /*tp_basicsize*/
22454  0, /*tp_itemsize*/
22455  __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, /*tp_dealloc*/
22456  0, /*tp_print*/
22457  0, /*tp_getattr*/
22458  0, /*tp_setattr*/
22459  #if PY_MAJOR_VERSION < 3
22460  0, /*tp_compare*/
22461  #endif
22462  #if PY_MAJOR_VERSION >= 3
22463  0, /*tp_as_async*/
22464  #endif
22465  0, /*tp_repr*/
22466  0, /*tp_as_number*/
22467  0, /*tp_as_sequence*/
22468  0, /*tp_as_mapping*/
22469  0, /*tp_hash*/
22470  0, /*tp_call*/
22471  0, /*tp_str*/
22472  0, /*tp_getattro*/
22473  0, /*tp_setattro*/
22474  0, /*tp_as_buffer*/
22475  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22476  0, /*tp_doc*/
22477  __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, /*tp_traverse*/
22478  __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, /*tp_clear*/
22479  0, /*tp_richcompare*/
22480  0, /*tp_weaklistoffset*/
22481  0, /*tp_iter*/
22482  0, /*tp_iternext*/
22483  0, /*tp_methods*/
22484  0, /*tp_members*/
22485  0, /*tp_getset*/
22486  0, /*tp_base*/
22487  0, /*tp_dict*/
22488  0, /*tp_descr_get*/
22489  0, /*tp_descr_set*/
22490  0, /*tp_dictoffset*/
22491  0, /*tp_init*/
22492  0, /*tp_alloc*/
22493  __pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, /*tp_new*/
22494  0, /*tp_free*/
22495  0, /*tp_is_gc*/
22496  0, /*tp_bases*/
22497  0, /*tp_mro*/
22498  0, /*tp_cache*/
22499  0, /*tp_subclasses*/
22500  0, /*tp_weaklist*/
22501  0, /*tp_del*/
22502  0, /*tp_version_tag*/
22503  #if PY_VERSION_HEX >= 0x030400a1
22504  0, /*tp_finalize*/
22505  #endif
22506 };
22507 
22508 static struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_freelist_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp[8];
22509 static int __pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = 0;
22510 
22511 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
22512  PyObject *o;
22513  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp)))) {
22514  o = (PyObject*)__pyx_freelist_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp[--__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp];
22515  memset(o, 0, sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp));
22516  (void) PyObject_INIT(o, t);
22517  PyObject_GC_Track(o);
22518  } else {
22519  o = (*t->tp_alloc)(t, 0);
22520  if (unlikely(!o)) return 0;
22521  }
22522  return o;
22523 }
22524 
22525 static void __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyObject *o) {
22526  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o;
22527  PyObject_GC_UnTrack(o);
22528  Py_CLEAR(p->__pyx_v_t1);
22529  Py_CLEAR(p->__pyx_v_value);
22530  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp)))) {
22531  __pyx_freelist_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp[__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp++] = ((struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o);
22532  } else {
22533  (*Py_TYPE(o)->tp_free)(o);
22534  }
22535 }
22536 
22537 static int __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyObject *o, visitproc v, void *a) {
22538  int e;
22539  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o;
22540  if (p->__pyx_v_t1) {
22541  e = (*v)(p->__pyx_v_t1, a); if (e) return e;
22542  }
22543  if (p->__pyx_v_value) {
22544  e = (*v)(p->__pyx_v_value, a); if (e) return e;
22545  }
22546  return 0;
22547 }
22548 
22549 static int __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyObject *o) {
22550  PyObject* tmp;
22551  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o;
22552  tmp = ((PyObject*)p->__pyx_v_t1);
22553  p->__pyx_v_t1 = Py_None; Py_INCREF(Py_None);
22554  Py_XDECREF(tmp);
22555  tmp = ((PyObject*)p->__pyx_v_value);
22556  p->__pyx_v_value = Py_None; Py_INCREF(Py_None);
22557  Py_XDECREF(tmp);
22558  return 0;
22559 }
22560 
22561 static PyTypeObject __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = {
22562  PyVarObject_HEAD_INIT(0, 0)
22563  "BoundaryConditions.__pyx_scope_struct_2_setLinearRamp", /*tp_name*/
22564  sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp), /*tp_basicsize*/
22565  0, /*tp_itemsize*/
22566  __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp, /*tp_dealloc*/
22567  0, /*tp_print*/
22568  0, /*tp_getattr*/
22569  0, /*tp_setattr*/
22570  #if PY_MAJOR_VERSION < 3
22571  0, /*tp_compare*/
22572  #endif
22573  #if PY_MAJOR_VERSION >= 3
22574  0, /*tp_as_async*/
22575  #endif
22576  0, /*tp_repr*/
22577  0, /*tp_as_number*/
22578  0, /*tp_as_sequence*/
22579  0, /*tp_as_mapping*/
22580  0, /*tp_hash*/
22581  0, /*tp_call*/
22582  0, /*tp_str*/
22583  0, /*tp_getattro*/
22584  0, /*tp_setattro*/
22585  0, /*tp_as_buffer*/
22586  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22587  0, /*tp_doc*/
22588  __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp, /*tp_traverse*/
22589  __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp, /*tp_clear*/
22590  0, /*tp_richcompare*/
22591  0, /*tp_weaklistoffset*/
22592  0, /*tp_iter*/
22593  0, /*tp_iternext*/
22594  0, /*tp_methods*/
22595  0, /*tp_members*/
22596  0, /*tp_getset*/
22597  0, /*tp_base*/
22598  0, /*tp_dict*/
22599  0, /*tp_descr_get*/
22600  0, /*tp_descr_set*/
22601  0, /*tp_dictoffset*/
22602  0, /*tp_init*/
22603  0, /*tp_alloc*/
22604  __pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp, /*tp_new*/
22605  0, /*tp_free*/
22606  0, /*tp_is_gc*/
22607  0, /*tp_bases*/
22608  0, /*tp_mro*/
22609  0, /*tp_cache*/
22610  0, /*tp_subclasses*/
22611  0, /*tp_weaklist*/
22612  0, /*tp_del*/
22613  0, /*tp_version_tag*/
22614  #if PY_VERSION_HEX >= 0x030400a1
22615  0, /*tp_finalize*/
22616  #endif
22617 };
22618 static struct __pyx_vtabstruct_array __pyx_vtable_array;
22619 
22620 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
22621  struct __pyx_array_obj *p;
22622  PyObject *o;
22623  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22624  o = (*t->tp_alloc)(t, 0);
22625  } else {
22626  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22627  }
22628  if (unlikely(!o)) return 0;
22629  p = ((struct __pyx_array_obj *)o);
22630  p->__pyx_vtab = __pyx_vtabptr_array;
22631  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
22632  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
22633  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
22634  return o;
22635  bad:
22636  Py_DECREF(o); o = 0;
22637  return NULL;
22638 }
22639 
22640 static void __pyx_tp_dealloc_array(PyObject *o) {
22641  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
22642  #if CYTHON_USE_TP_FINALIZE
22643  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
22644  if (PyObject_CallFinalizerFromDealloc(o)) return;
22645  }
22646  #endif
22647  {
22648  PyObject *etype, *eval, *etb;
22649  PyErr_Fetch(&etype, &eval, &etb);
22650  ++Py_REFCNT(o);
22651  __pyx_array___dealloc__(o);
22652  --Py_REFCNT(o);
22653  PyErr_Restore(etype, eval, etb);
22654  }
22655  Py_CLEAR(p->mode);
22656  Py_CLEAR(p->_format);
22657  (*Py_TYPE(o)->tp_free)(o);
22658 }
22659 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
22660  PyObject *r;
22661  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
22662  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
22663  Py_DECREF(x);
22664  return r;
22665 }
22666 
22667 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
22668  if (v) {
22669  return __pyx_array___setitem__(o, i, v);
22670  }
22671  else {
22672  PyErr_Format(PyExc_NotImplementedError,
22673  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
22674  return -1;
22675  }
22676 }
22677 
22678 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
22679  PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
22680  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
22681  PyErr_Clear();
22682  v = __pyx_array___getattr__(o, n);
22683  }
22684  return v;
22685 }
22686 
22687 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
22688  return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
22689 }
22690 
22691 static PyMethodDef __pyx_methods_array[] = {
22692  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
22693  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
22694  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
22695  {0, 0, 0, 0}
22696 };
22697 
22698 static struct PyGetSetDef __pyx_getsets_array[] = {
22699  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
22700  {0, 0, 0, 0, 0}
22701 };
22702 
22703 static PySequenceMethods __pyx_tp_as_sequence_array = {
22704  __pyx_array___len__, /*sq_length*/
22705  0, /*sq_concat*/
22706  0, /*sq_repeat*/
22707  __pyx_sq_item_array, /*sq_item*/
22708  0, /*sq_slice*/
22709  0, /*sq_ass_item*/
22710  0, /*sq_ass_slice*/
22711  0, /*sq_contains*/
22712  0, /*sq_inplace_concat*/
22713  0, /*sq_inplace_repeat*/
22714 };
22715 
22716 static PyMappingMethods __pyx_tp_as_mapping_array = {
22717  __pyx_array___len__, /*mp_length*/
22718  __pyx_array___getitem__, /*mp_subscript*/
22719  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
22720 };
22721 
22722 static PyBufferProcs __pyx_tp_as_buffer_array = {
22723  #if PY_MAJOR_VERSION < 3
22724  0, /*bf_getreadbuffer*/
22725  #endif
22726  #if PY_MAJOR_VERSION < 3
22727  0, /*bf_getwritebuffer*/
22728  #endif
22729  #if PY_MAJOR_VERSION < 3
22730  0, /*bf_getsegcount*/
22731  #endif
22732  #if PY_MAJOR_VERSION < 3
22733  0, /*bf_getcharbuffer*/
22734  #endif
22735  __pyx_array_getbuffer, /*bf_getbuffer*/
22736  0, /*bf_releasebuffer*/
22737 };
22738 
22739 static PyTypeObject __pyx_type___pyx_array = {
22740  PyVarObject_HEAD_INIT(0, 0)
22741  "BoundaryConditions.array", /*tp_name*/
22742  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
22743  0, /*tp_itemsize*/
22744  __pyx_tp_dealloc_array, /*tp_dealloc*/
22745  0, /*tp_print*/
22746  0, /*tp_getattr*/
22747  0, /*tp_setattr*/
22748  #if PY_MAJOR_VERSION < 3
22749  0, /*tp_compare*/
22750  #endif
22751  #if PY_MAJOR_VERSION >= 3
22752  0, /*tp_as_async*/
22753  #endif
22754  0, /*tp_repr*/
22755  0, /*tp_as_number*/
22756  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
22757  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
22758  0, /*tp_hash*/
22759  0, /*tp_call*/
22760  0, /*tp_str*/
22761  __pyx_tp_getattro_array, /*tp_getattro*/
22762  0, /*tp_setattro*/
22763  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
22764  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
22765  0, /*tp_doc*/
22766  0, /*tp_traverse*/
22767  0, /*tp_clear*/
22768  0, /*tp_richcompare*/
22769  0, /*tp_weaklistoffset*/
22770  0, /*tp_iter*/
22771  0, /*tp_iternext*/
22772  __pyx_methods_array, /*tp_methods*/
22773  0, /*tp_members*/
22774  __pyx_getsets_array, /*tp_getset*/
22775  0, /*tp_base*/
22776  0, /*tp_dict*/
22777  0, /*tp_descr_get*/
22778  0, /*tp_descr_set*/
22779  0, /*tp_dictoffset*/
22780  0, /*tp_init*/
22781  0, /*tp_alloc*/
22782  __pyx_tp_new_array, /*tp_new*/
22783  0, /*tp_free*/
22784  0, /*tp_is_gc*/
22785  0, /*tp_bases*/
22786  0, /*tp_mro*/
22787  0, /*tp_cache*/
22788  0, /*tp_subclasses*/
22789  0, /*tp_weaklist*/
22790  0, /*tp_del*/
22791  0, /*tp_version_tag*/
22792  #if PY_VERSION_HEX >= 0x030400a1
22793  0, /*tp_finalize*/
22794  #endif
22795 };
22796 
22797 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
22798  struct __pyx_MemviewEnum_obj *p;
22799  PyObject *o;
22800  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22801  o = (*t->tp_alloc)(t, 0);
22802  } else {
22803  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22804  }
22805  if (unlikely(!o)) return 0;
22806  p = ((struct __pyx_MemviewEnum_obj *)o);
22807  p->name = Py_None; Py_INCREF(Py_None);
22808  return o;
22809 }
22810 
22811 static void __pyx_tp_dealloc_Enum(PyObject *o) {
22812  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
22813  #if CYTHON_USE_TP_FINALIZE
22814  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22815  if (PyObject_CallFinalizerFromDealloc(o)) return;
22816  }
22817  #endif
22818  PyObject_GC_UnTrack(o);
22819  Py_CLEAR(p->name);
22820  (*Py_TYPE(o)->tp_free)(o);
22821 }
22822 
22823 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
22824  int e;
22825  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
22826  if (p->name) {
22827  e = (*v)(p->name, a); if (e) return e;
22828  }
22829  return 0;
22830 }
22831 
22832 static int __pyx_tp_clear_Enum(PyObject *o) {
22833  PyObject* tmp;
22834  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
22835  tmp = ((PyObject*)p->name);
22836  p->name = Py_None; Py_INCREF(Py_None);
22837  Py_XDECREF(tmp);
22838  return 0;
22839 }
22840 
22841 static PyMethodDef __pyx_methods_Enum[] = {
22842  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
22843  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
22844  {0, 0, 0, 0}
22845 };
22846 
22847 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
22848  PyVarObject_HEAD_INIT(0, 0)
22849  "BoundaryConditions.Enum", /*tp_name*/
22850  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
22851  0, /*tp_itemsize*/
22852  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
22853  0, /*tp_print*/
22854  0, /*tp_getattr*/
22855  0, /*tp_setattr*/
22856  #if PY_MAJOR_VERSION < 3
22857  0, /*tp_compare*/
22858  #endif
22859  #if PY_MAJOR_VERSION >= 3
22860  0, /*tp_as_async*/
22861  #endif
22862  __pyx_MemviewEnum___repr__, /*tp_repr*/
22863  0, /*tp_as_number*/
22864  0, /*tp_as_sequence*/
22865  0, /*tp_as_mapping*/
22866  0, /*tp_hash*/
22867  0, /*tp_call*/
22868  0, /*tp_str*/
22869  0, /*tp_getattro*/
22870  0, /*tp_setattro*/
22871  0, /*tp_as_buffer*/
22872  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22873  0, /*tp_doc*/
22874  __pyx_tp_traverse_Enum, /*tp_traverse*/
22875  __pyx_tp_clear_Enum, /*tp_clear*/
22876  0, /*tp_richcompare*/
22877  0, /*tp_weaklistoffset*/
22878  0, /*tp_iter*/
22879  0, /*tp_iternext*/
22880  __pyx_methods_Enum, /*tp_methods*/
22881  0, /*tp_members*/
22882  0, /*tp_getset*/
22883  0, /*tp_base*/
22884  0, /*tp_dict*/
22885  0, /*tp_descr_get*/
22886  0, /*tp_descr_set*/
22887  0, /*tp_dictoffset*/
22888  __pyx_MemviewEnum___init__, /*tp_init*/
22889  0, /*tp_alloc*/
22890  __pyx_tp_new_Enum, /*tp_new*/
22891  0, /*tp_free*/
22892  0, /*tp_is_gc*/
22893  0, /*tp_bases*/
22894  0, /*tp_mro*/
22895  0, /*tp_cache*/
22896  0, /*tp_subclasses*/
22897  0, /*tp_weaklist*/
22898  0, /*tp_del*/
22899  0, /*tp_version_tag*/
22900  #if PY_VERSION_HEX >= 0x030400a1
22901  0, /*tp_finalize*/
22902  #endif
22903 };
22904 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
22905 
22906 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
22907  struct __pyx_memoryview_obj *p;
22908  PyObject *o;
22909  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22910  o = (*t->tp_alloc)(t, 0);
22911  } else {
22912  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22913  }
22914  if (unlikely(!o)) return 0;
22915  p = ((struct __pyx_memoryview_obj *)o);
22916  p->__pyx_vtab = __pyx_vtabptr_memoryview;
22917  p->obj = Py_None; Py_INCREF(Py_None);
22918  p->_size = Py_None; Py_INCREF(Py_None);
22919  p->_array_interface = Py_None; Py_INCREF(Py_None);
22920  p->view.obj = NULL;
22921  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
22922  return o;
22923  bad:
22924  Py_DECREF(o); o = 0;
22925  return NULL;
22926 }
22927 
22928 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
22929  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
22930  #if CYTHON_USE_TP_FINALIZE
22931  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22932  if (PyObject_CallFinalizerFromDealloc(o)) return;
22933  }
22934  #endif
22935  PyObject_GC_UnTrack(o);
22936  {
22937  PyObject *etype, *eval, *etb;
22938  PyErr_Fetch(&etype, &eval, &etb);
22939  ++Py_REFCNT(o);
22940  __pyx_memoryview___dealloc__(o);
22941  --Py_REFCNT(o);
22942  PyErr_Restore(etype, eval, etb);
22943  }
22944  Py_CLEAR(p->obj);
22945  Py_CLEAR(p->_size);
22946  Py_CLEAR(p->_array_interface);
22947  (*Py_TYPE(o)->tp_free)(o);
22948 }
22949 
22950 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
22951  int e;
22952  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
22953  if (p->obj) {
22954  e = (*v)(p->obj, a); if (e) return e;
22955  }
22956  if (p->_size) {
22957  e = (*v)(p->_size, a); if (e) return e;
22958  }
22959  if (p->_array_interface) {
22960  e = (*v)(p->_array_interface, a); if (e) return e;
22961  }
22962  if (p->view.obj) {
22963  e = (*v)(p->view.obj, a); if (e) return e;
22964  }
22965  return 0;
22966 }
22967 
22968 static int __pyx_tp_clear_memoryview(PyObject *o) {
22969  PyObject* tmp;
22970  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
22971  tmp = ((PyObject*)p->obj);
22972  p->obj = Py_None; Py_INCREF(Py_None);
22973  Py_XDECREF(tmp);
22974  tmp = ((PyObject*)p->_size);
22975  p->_size = Py_None; Py_INCREF(Py_None);
22976  Py_XDECREF(tmp);
22977  tmp = ((PyObject*)p->_array_interface);
22978  p->_array_interface = Py_None; Py_INCREF(Py_None);
22979  Py_XDECREF(tmp);
22980  Py_CLEAR(p->view.obj);
22981  return 0;
22982 }
22983 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
22984  PyObject *r;
22985  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
22986  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
22987  Py_DECREF(x);
22988  return r;
22989 }
22990 
22991 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
22992  if (v) {
22993  return __pyx_memoryview___setitem__(o, i, v);
22994  }
22995  else {
22996  PyErr_Format(PyExc_NotImplementedError,
22997  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
22998  return -1;
22999  }
23000 }
23001 
23002 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
23003  return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
23004 }
23005 
23006 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
23007  return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
23008 }
23009 
23010 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
23011  return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
23012 }
23013 
23014 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
23015  return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
23016 }
23017 
23018 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
23019  return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
23020 }
23021 
23022 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
23023  return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
23024 }
23025 
23026 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
23027  return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
23028 }
23029 
23030 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
23031  return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
23032 }
23033 
23034 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
23035  return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
23036 }
23037 
23038 static PyMethodDef __pyx_methods_memoryview[] = {
23039  {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
23040  {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
23041  {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
23042  {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
23043  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
23044  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
23045  {0, 0, 0, 0}
23046 };
23047 
23048 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
23049  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
23050  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
23051  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
23052  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
23053  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
23054  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
23055  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
23056  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
23057  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
23058  {0, 0, 0, 0, 0}
23059 };
23060 
23061 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
23062  __pyx_memoryview___len__, /*sq_length*/
23063  0, /*sq_concat*/
23064  0, /*sq_repeat*/
23065  __pyx_sq_item_memoryview, /*sq_item*/
23066  0, /*sq_slice*/
23067  0, /*sq_ass_item*/
23068  0, /*sq_ass_slice*/
23069  0, /*sq_contains*/
23070  0, /*sq_inplace_concat*/
23071  0, /*sq_inplace_repeat*/
23072 };
23073 
23074 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
23075  __pyx_memoryview___len__, /*mp_length*/
23076  __pyx_memoryview___getitem__, /*mp_subscript*/
23077  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
23078 };
23079 
23080 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
23081  #if PY_MAJOR_VERSION < 3
23082  0, /*bf_getreadbuffer*/
23083  #endif
23084  #if PY_MAJOR_VERSION < 3
23085  0, /*bf_getwritebuffer*/
23086  #endif
23087  #if PY_MAJOR_VERSION < 3
23088  0, /*bf_getsegcount*/
23089  #endif
23090  #if PY_MAJOR_VERSION < 3
23091  0, /*bf_getcharbuffer*/
23092  #endif
23093  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
23094  0, /*bf_releasebuffer*/
23095 };
23096 
23097 static PyTypeObject __pyx_type___pyx_memoryview = {
23098  PyVarObject_HEAD_INIT(0, 0)
23099  "BoundaryConditions.memoryview", /*tp_name*/
23100  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
23101  0, /*tp_itemsize*/
23102  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
23103  0, /*tp_print*/
23104  0, /*tp_getattr*/
23105  0, /*tp_setattr*/
23106  #if PY_MAJOR_VERSION < 3
23107  0, /*tp_compare*/
23108  #endif
23109  #if PY_MAJOR_VERSION >= 3
23110  0, /*tp_as_async*/
23111  #endif
23112  __pyx_memoryview___repr__, /*tp_repr*/
23113  0, /*tp_as_number*/
23114  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
23115  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
23116  0, /*tp_hash*/
23117  0, /*tp_call*/
23118  __pyx_memoryview___str__, /*tp_str*/
23119  0, /*tp_getattro*/
23120  0, /*tp_setattro*/
23121  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
23122  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
23123  0, /*tp_doc*/
23124  __pyx_tp_traverse_memoryview, /*tp_traverse*/
23125  __pyx_tp_clear_memoryview, /*tp_clear*/
23126  0, /*tp_richcompare*/
23127  0, /*tp_weaklistoffset*/
23128  0, /*tp_iter*/
23129  0, /*tp_iternext*/
23130  __pyx_methods_memoryview, /*tp_methods*/
23131  0, /*tp_members*/
23132  __pyx_getsets_memoryview, /*tp_getset*/
23133  0, /*tp_base*/
23134  0, /*tp_dict*/
23135  0, /*tp_descr_get*/
23136  0, /*tp_descr_set*/
23137  0, /*tp_dictoffset*/
23138  0, /*tp_init*/
23139  0, /*tp_alloc*/
23140  __pyx_tp_new_memoryview, /*tp_new*/
23141  0, /*tp_free*/
23142  0, /*tp_is_gc*/
23143  0, /*tp_bases*/
23144  0, /*tp_mro*/
23145  0, /*tp_cache*/
23146  0, /*tp_subclasses*/
23147  0, /*tp_weaklist*/
23148  0, /*tp_del*/
23149  0, /*tp_version_tag*/
23150  #if PY_VERSION_HEX >= 0x030400a1
23151  0, /*tp_finalize*/
23152  #endif
23153 };
23154 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
23155 
23156 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
23157  struct __pyx_memoryviewslice_obj *p;
23158  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
23159  if (unlikely(!o)) return 0;
23160  p = ((struct __pyx_memoryviewslice_obj *)o);
23161  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
23162  p->from_object = Py_None; Py_INCREF(Py_None);
23163  p->from_slice.memview = NULL;
23164  return o;
23165 }
23166 
23167 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
23168  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
23169  #if CYTHON_USE_TP_FINALIZE
23170  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
23171  if (PyObject_CallFinalizerFromDealloc(o)) return;
23172  }
23173  #endif
23174  PyObject_GC_UnTrack(o);
23175  {
23176  PyObject *etype, *eval, *etb;
23177  PyErr_Fetch(&etype, &eval, &etb);
23178  ++Py_REFCNT(o);
23179  __pyx_memoryviewslice___dealloc__(o);
23180  --Py_REFCNT(o);
23181  PyErr_Restore(etype, eval, etb);
23182  }
23183  Py_CLEAR(p->from_object);
23184  PyObject_GC_Track(o);
23185  __pyx_tp_dealloc_memoryview(o);
23186 }
23187 
23188 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
23189  int e;
23190  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
23191  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
23192  if (p->from_object) {
23193  e = (*v)(p->from_object, a); if (e) return e;
23194  }
23195  return 0;
23196 }
23197 
23198 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
23199  PyObject* tmp;
23200  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
23201  __pyx_tp_clear_memoryview(o);
23202  tmp = ((PyObject*)p->from_object);
23203  p->from_object = Py_None; Py_INCREF(Py_None);
23204  Py_XDECREF(tmp);
23205  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
23206  return 0;
23207 }
23208 
23209 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
23210  return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
23211 }
23212 
23213 static PyMethodDef __pyx_methods__memoryviewslice[] = {
23214  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
23215  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
23216  {0, 0, 0, 0}
23217 };
23218 
23219 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
23220  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
23221  {0, 0, 0, 0, 0}
23222 };
23223 
23224 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
23225  PyVarObject_HEAD_INIT(0, 0)
23226  "BoundaryConditions._memoryviewslice", /*tp_name*/
23227  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
23228  0, /*tp_itemsize*/
23229  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
23230  0, /*tp_print*/
23231  0, /*tp_getattr*/
23232  0, /*tp_setattr*/
23233  #if PY_MAJOR_VERSION < 3
23234  0, /*tp_compare*/
23235  #endif
23236  #if PY_MAJOR_VERSION >= 3
23237  0, /*tp_as_async*/
23238  #endif
23239  #if CYTHON_COMPILING_IN_PYPY
23240  __pyx_memoryview___repr__, /*tp_repr*/
23241  #else
23242  0, /*tp_repr*/
23243  #endif
23244  0, /*tp_as_number*/
23245  0, /*tp_as_sequence*/
23246  0, /*tp_as_mapping*/
23247  0, /*tp_hash*/
23248  0, /*tp_call*/
23249  #if CYTHON_COMPILING_IN_PYPY
23250  __pyx_memoryview___str__, /*tp_str*/
23251  #else
23252  0, /*tp_str*/
23253  #endif
23254  0, /*tp_getattro*/
23255  0, /*tp_setattro*/
23256  0, /*tp_as_buffer*/
23257  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
23258  "Internal class for passing memoryview slices to Python", /*tp_doc*/
23259  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
23260  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
23261  0, /*tp_richcompare*/
23262  0, /*tp_weaklistoffset*/
23263  0, /*tp_iter*/
23264  0, /*tp_iternext*/
23265  __pyx_methods__memoryviewslice, /*tp_methods*/
23266  0, /*tp_members*/
23267  __pyx_getsets__memoryviewslice, /*tp_getset*/
23268  0, /*tp_base*/
23269  0, /*tp_dict*/
23270  0, /*tp_descr_get*/
23271  0, /*tp_descr_set*/
23272  0, /*tp_dictoffset*/
23273  0, /*tp_init*/
23274  0, /*tp_alloc*/
23275  __pyx_tp_new__memoryviewslice, /*tp_new*/
23276  0, /*tp_free*/
23277  0, /*tp_is_gc*/
23278  0, /*tp_bases*/
23279  0, /*tp_mro*/
23280  0, /*tp_cache*/
23281  0, /*tp_subclasses*/
23282  0, /*tp_weaklist*/
23283  0, /*tp_del*/
23284  0, /*tp_version_tag*/
23285  #if PY_VERSION_HEX >= 0x030400a1
23286  0, /*tp_finalize*/
23287  #endif
23288 };
23289 
23290 static PyMethodDef __pyx_methods[] = {
23291  {0, 0, 0, 0}
23292 };
23293 
23294 #if PY_MAJOR_VERSION >= 3
23295 #if CYTHON_PEP489_MULTI_PHASE_INIT
23296 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
23297 static int __pyx_pymod_exec_BoundaryConditions(PyObject* module); /*proto*/
23298 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
23299  {Py_mod_create, (void*)__pyx_pymod_create},
23300  {Py_mod_exec, (void*)__pyx_pymod_exec_BoundaryConditions},
23301  {0, NULL}
23302 };
23303 #endif
23304 
23305 static struct PyModuleDef __pyx_moduledef = {
23306  PyModuleDef_HEAD_INIT,
23307  "BoundaryConditions",
23308  0, /* m_doc */
23309  #if CYTHON_PEP489_MULTI_PHASE_INIT
23310  0, /* m_size */
23311  #else
23312  -1, /* m_size */
23313  #endif
23314  __pyx_methods /* m_methods */,
23315  #if CYTHON_PEP489_MULTI_PHASE_INIT
23316  __pyx_moduledef_slots, /* m_slots */
23317  #else
23318  NULL, /* m_reload */
23319  #endif
23320  NULL, /* m_traverse */
23321  NULL, /* m_clear */
23322  NULL /* m_free */
23323 };
23324 #endif
23325 #ifndef CYTHON_SMALL_CODE
23326 #if defined(__clang__)
23327  #define CYTHON_SMALL_CODE
23328 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
23329  #define CYTHON_SMALL_CODE __attribute__((cold))
23330 #else
23331  #define CYTHON_SMALL_CODE
23332 #endif
23333 #endif
23334 
23335 static __Pyx_StringTabEntry __pyx_string_tab[] = {
23336  {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
23337  {&__pyx_n_s_BC_Base, __pyx_k_BC_Base, sizeof(__pyx_k_BC_Base), 0, 0, 1, 1},
23338  {&__pyx_n_s_BC_Base___reduce_cython, __pyx_k_BC_Base___reduce_cython, sizeof(__pyx_k_BC_Base___reduce_cython), 0, 0, 1, 1},
23339  {&__pyx_n_s_BC_Base___setstate_cython, __pyx_k_BC_Base___setstate_cython, sizeof(__pyx_k_BC_Base___setstate_cython), 0, 0, 1, 1},
23340  {&__pyx_n_s_BC_Base_getContext, __pyx_k_BC_Base_getContext, sizeof(__pyx_k_BC_Base_getContext), 0, 0, 1, 1},
23341  {&__pyx_n_s_BoundaryCondition, __pyx_k_BoundaryCondition, sizeof(__pyx_k_BoundaryCondition), 0, 0, 1, 1},
23342  {&__pyx_n_s_BoundaryCondition___reduce_cytho, __pyx_k_BoundaryCondition___reduce_cytho, sizeof(__pyx_k_BoundaryCondition___reduce_cytho), 0, 0, 1, 1},
23343  {&__pyx_n_s_BoundaryCondition___setstate_cyt, __pyx_k_BoundaryCondition___setstate_cyt, sizeof(__pyx_k_BoundaryCondition___setstate_cyt), 0, 0, 1, 1},
23344  {&__pyx_n_s_BoundaryCondition_init_cython, __pyx_k_BoundaryCondition_init_cython, sizeof(__pyx_k_BoundaryCondition_init_cython), 0, 0, 1, 1},
23345  {&__pyx_n_s_BoundaryCondition_resetBC, __pyx_k_BoundaryCondition_resetBC, sizeof(__pyx_k_BoundaryCondition_resetBC), 0, 0, 1, 1},
23346  {&__pyx_n_s_BoundaryCondition_setConstantBC, __pyx_k_BoundaryCondition_setConstantBC, sizeof(__pyx_k_BoundaryCondition_setConstantBC), 0, 0, 1, 1},
23347  {&__pyx_n_s_BoundaryCondition_setLinearBC, __pyx_k_BoundaryCondition_setLinearBC, sizeof(__pyx_k_BoundaryCondition_setLinearBC), 0, 0, 1, 1},
23348  {&__pyx_n_s_BoundaryCondition_setLinearRamp, __pyx_k_BoundaryCondition_setLinearRamp, sizeof(__pyx_k_BoundaryCondition_setLinearRamp), 0, 0, 1, 1},
23349  {&__pyx_n_s_BoundaryConditions, __pyx_k_BoundaryConditions, sizeof(__pyx_k_BoundaryConditions), 0, 0, 1, 1},
23350  {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
23351  {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
23352  {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
23353  {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
23354  {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
23355  {&__pyx_n_s_Context, __pyx_k_Context, sizeof(__pyx_k_Context), 0, 0, 1, 1},
23356  {&__pyx_n_s_Domain, __pyx_k_Domain, sizeof(__pyx_k_Domain), 0, 0, 1, 1},
23357  {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
23358  {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
23359  {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
23360  {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
23361  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
23362  {&__pyx_kp_s_Incompatible_checksums_s_vs_0x96, __pyx_k_Incompatible_checksums_s_vs_0x96, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x96), 0, 0, 1, 0},
23363  {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
23364  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
23365  {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
23366  {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
23367  {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
23368  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
23369  {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
23370  {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
23371  {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
23372  {&__pyx_n_s_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 0, 1, 1},
23373  {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
23374  {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
23375  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
23376  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
23377  {&__pyx_kp_s_Shape_or_nd_must_be_passed_to_BC, __pyx_k_Shape_or_nd_must_be_passed_to_BC, sizeof(__pyx_k_Shape_or_nd_must_be_passed_to_BC), 0, 0, 1, 0},
23378  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
23379  {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
23380  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
23381  {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
23382  {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},
23383  {&__pyx_n_s_a0, __pyx_k_a0, sizeof(__pyx_k_a0), 0, 0, 1, 1},
23384  {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
23385  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
23386  {&__pyx_n_s_b_i, __pyx_k_b_i, sizeof(__pyx_k_b_i), 0, 0, 1, 1},
23387  {&__pyx_n_s_b_or, __pyx_k_b_or, sizeof(__pyx_k_b_or), 0, 0, 1, 1},
23388  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
23389  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
23390  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
23391  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
23392  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
23393  {&__pyx_n_s_context, __pyx_k_context, sizeof(__pyx_k_context), 0, 0, 1, 1},
23394  {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
23395  {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
23396  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
23397  {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1},
23398  {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
23399  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
23400  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
23401  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
23402  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
23403  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
23404  {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
23405  {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
23406  {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
23407  {&__pyx_n_s_getContext, __pyx_k_getContext, sizeof(__pyx_k_getContext), 0, 0, 1, 1},
23408  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
23409  {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
23410  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
23411  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
23412  {&__pyx_n_s_init_cython, __pyx_k_init_cython, sizeof(__pyx_k_init_cython), 0, 0, 1, 1},
23413  {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
23414  {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
23415  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
23416  {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
23417  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
23418  {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
23419  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
23420  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
23421  {&__pyx_n_s_nd, __pyx_k_nd, sizeof(__pyx_k_nd), 0, 0, 1, 1},
23422  {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
23423  {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
23424  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
23425  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
23426  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
23427  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
23428  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
23429  {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
23430  {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
23431  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
23432  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
23433  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
23434  {&__pyx_n_s_proteus, __pyx_k_proteus, sizeof(__pyx_k_proteus), 0, 0, 1, 1},
23435  {&__pyx_kp_s_proteus_BoundaryConditions_py, __pyx_k_proteus_BoundaryConditions_py, sizeof(__pyx_k_proteus_BoundaryConditions_py), 0, 0, 1, 0},
23436  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
23437  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
23438  {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
23439  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
23440  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
23441  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
23442  {&__pyx_n_s_pyx_unpickle_BC_Base, __pyx_k_pyx_unpickle_BC_Base, sizeof(__pyx_k_pyx_unpickle_BC_Base), 0, 0, 1, 1},
23443  {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
23444  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
23445  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
23446  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
23447  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
23448  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
23449  {&__pyx_n_s_resetBC, __pyx_k_resetBC, sizeof(__pyx_k_resetBC), 0, 0, 1, 1},
23450  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
23451  {&__pyx_kp_s_self_uuOfXT_cannot_be_converted, __pyx_k_self_uuOfXT_cannot_be_converted, sizeof(__pyx_k_self_uuOfXT_cannot_be_converted), 0, 0, 1, 0},
23452  {&__pyx_n_s_setConstantBC, __pyx_k_setConstantBC, sizeof(__pyx_k_setConstantBC), 0, 0, 1, 1},
23453  {&__pyx_n_s_setConstantBC_locals_lambda, __pyx_k_setConstantBC_locals_lambda, sizeof(__pyx_k_setConstantBC_locals_lambda), 0, 0, 1, 1},
23454  {&__pyx_n_s_setLinearBC, __pyx_k_setLinearBC, sizeof(__pyx_k_setLinearBC), 0, 0, 1, 1},
23455  {&__pyx_n_s_setLinearBC_locals_lambda, __pyx_k_setLinearBC_locals_lambda, sizeof(__pyx_k_setLinearBC_locals_lambda), 0, 0, 1, 1},
23456  {&__pyx_n_s_setLinearRamp, __pyx_k_setLinearRamp, sizeof(__pyx_k_setLinearRamp), 0, 0, 1, 1},
23457  {&__pyx_n_s_setLinearRamp_locals_lambda, __pyx_k_setLinearRamp_locals_lambda, sizeof(__pyx_k_setLinearRamp_locals_lambda), 0, 0, 1, 1},
23458  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
23459  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
23460  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
23461  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
23462  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
23463  {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1},
23464  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
23465  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
23466  {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
23467  {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
23468  {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
23469  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
23470  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
23471  {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1},
23472  {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1},
23473  {&__pyx_n_s_t1, __pyx_k_t1, sizeof(__pyx_k_t1), 0, 0, 1, 1},
23474  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
23475  {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
23476  {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
23477  {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
23478  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
23479  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
23480  {&__pyx_n_s_use_setstate, __pyx_k_use_setstate, sizeof(__pyx_k_use_setstate), 0, 0, 1, 1},
23481  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
23482  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
23483  {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
23484  {0, 0, 0, 0, 0, 0, 0}
23485 };
23486 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
23487  __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 113, __pyx_L1_error)
23488  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
23489  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(3, 272, __pyx_L1_error)
23490  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(3, 285, __pyx_L1_error)
23491  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(3, 856, __pyx_L1_error)
23492  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(3, 1038, __pyx_L1_error)
23493  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 148, __pyx_L1_error)
23494  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 151, __pyx_L1_error)
23495  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 400, __pyx_L1_error)
23496  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 609, __pyx_L1_error)
23497  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 828, __pyx_L1_error)
23498  return 0;
23499  __pyx_L1_error:;
23500  return -1;
23501 }
23502 
23503 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
23504  __Pyx_RefNannyDeclarations
23505  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
23506 
23507  /* "BoundaryConditions.py":113
23508  * """
23509  *
23510  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:]) # <<<<<<<<<<<<<<
23511  *
23512  * def setLinearRamp(self,t1,value):
23513  */
23514  __pyx_slice__7 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__7)) __PYX_ERR(0, 113, __pyx_L1_error)
23515  __Pyx_GOTREF(__pyx_slice__7);
23516  __Pyx_GIVEREF(__pyx_slice__7);
23517 
23518  /* "(tree fragment)":2
23519  * def __reduce_cython__(self):
23520  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
23521  * def __setstate_cython__(self, __pyx_state):
23522  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
23523  */
23524  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_self_uuOfXT_cannot_be_converted); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 2, __pyx_L1_error)
23525  __Pyx_GOTREF(__pyx_tuple__11);
23526  __Pyx_GIVEREF(__pyx_tuple__11);
23527 
23528  /* "(tree fragment)":4
23529  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
23530  * def __setstate_cython__(self, __pyx_state):
23531  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
23532  */
23533  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_self_uuOfXT_cannot_be_converted); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 4, __pyx_L1_error)
23534  __Pyx_GOTREF(__pyx_tuple__13);
23535  __Pyx_GIVEREF(__pyx_tuple__13);
23536 
23537  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
23538  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
23539  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
23540  * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
23541  *
23542  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
23543  */
23544  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(3, 272, __pyx_L1_error)
23545  __Pyx_GOTREF(__pyx_tuple__15);
23546  __Pyx_GIVEREF(__pyx_tuple__15);
23547 
23548  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
23549  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
23550  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
23551  * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
23552  *
23553  * info.buf = PyArray_DATA(self)
23554  */
23555  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(3, 276, __pyx_L1_error)
23556  __Pyx_GOTREF(__pyx_tuple__16);
23557  __Pyx_GIVEREF(__pyx_tuple__16);
23558 
23559  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":306
23560  * if ((descr.byteorder == c'>' and little_endian) or
23561  * (descr.byteorder == c'<' and not little_endian)):
23562  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
23563  * if t == NPY_BYTE: f = "b"
23564  * elif t == NPY_UBYTE: f = "B"
23565  */
23566  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(3, 306, __pyx_L1_error)
23567  __Pyx_GOTREF(__pyx_tuple__17);
23568  __Pyx_GIVEREF(__pyx_tuple__17);
23569 
23570  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":856
23571  *
23572  * if (end - f) - <int>(new_offset - offset[0]) < 15:
23573  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
23574  *
23575  * if ((child.byteorder == c'>' and little_endian) or
23576  */
23577  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(3, 856, __pyx_L1_error)
23578  __Pyx_GOTREF(__pyx_tuple__18);
23579  __Pyx_GIVEREF(__pyx_tuple__18);
23580 
23581  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":880
23582  * t = child.type_num
23583  * if end - f < 5:
23584  * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
23585  *
23586  * # Until ticket #99 is fixed, use integers to avoid warnings
23587  */
23588  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(3, 880, __pyx_L1_error)
23589  __Pyx_GOTREF(__pyx_tuple__19);
23590  __Pyx_GIVEREF(__pyx_tuple__19);
23591 
23592  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1038
23593  * _import_array()
23594  * except Exception:
23595  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
23596  *
23597  * cdef inline int import_umath() except -1:
23598  */
23599  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(3, 1038, __pyx_L1_error)
23600  __Pyx_GOTREF(__pyx_tuple__20);
23601  __Pyx_GIVEREF(__pyx_tuple__20);
23602 
23603  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1044
23604  * _import_umath()
23605  * except Exception:
23606  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
23607  *
23608  * cdef inline int import_ufunc() except -1:
23609  */
23610  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(3, 1044, __pyx_L1_error)
23611  __Pyx_GOTREF(__pyx_tuple__21);
23612  __Pyx_GIVEREF(__pyx_tuple__21);
23613 
23614  /* "View.MemoryView":133
23615  *
23616  * if not self.ndim:
23617  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
23618  *
23619  * if itemsize <= 0:
23620  */
23621  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 133, __pyx_L1_error)
23622  __Pyx_GOTREF(__pyx_tuple__22);
23623  __Pyx_GIVEREF(__pyx_tuple__22);
23624 
23625  /* "View.MemoryView":136
23626  *
23627  * if itemsize <= 0:
23628  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
23629  *
23630  * if not isinstance(format, bytes):
23631  */
23632  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 136, __pyx_L1_error)
23633  __Pyx_GOTREF(__pyx_tuple__23);
23634  __Pyx_GIVEREF(__pyx_tuple__23);
23635 
23636  /* "View.MemoryView":148
23637  *
23638  * if not self._shape:
23639  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
23640  *
23641  *
23642  */
23643  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 148, __pyx_L1_error)
23644  __Pyx_GOTREF(__pyx_tuple__24);
23645  __Pyx_GIVEREF(__pyx_tuple__24);
23646 
23647  /* "View.MemoryView":176
23648  * self.data = <char *>malloc(self.len)
23649  * if not self.data:
23650  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
23651  *
23652  * if self.dtype_is_object:
23653  */
23654  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 176, __pyx_L1_error)
23655  __Pyx_GOTREF(__pyx_tuple__25);
23656  __Pyx_GIVEREF(__pyx_tuple__25);
23657 
23658  /* "View.MemoryView":192
23659  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
23660  * if not (flags & bufmode):
23661  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
23662  * info.buf = self.data
23663  * info.len = self.len
23664  */
23665  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 192, __pyx_L1_error)
23666  __Pyx_GOTREF(__pyx_tuple__26);
23667  __Pyx_GIVEREF(__pyx_tuple__26);
23668 
23669  /* "(tree fragment)":2
23670  * def __reduce_cython__(self):
23671  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23672  * def __setstate_cython__(self, __pyx_state):
23673  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23674  */
23675  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 2, __pyx_L1_error)
23676  __Pyx_GOTREF(__pyx_tuple__27);
23677  __Pyx_GIVEREF(__pyx_tuple__27);
23678 
23679  /* "(tree fragment)":4
23680  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23681  * def __setstate_cython__(self, __pyx_state):
23682  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23683  */
23684  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 4, __pyx_L1_error)
23685  __Pyx_GOTREF(__pyx_tuple__28);
23686  __Pyx_GIVEREF(__pyx_tuple__28);
23687 
23688  /* "View.MemoryView":414
23689  * def __setitem__(memoryview self, object index, object value):
23690  * if self.view.readonly:
23691  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
23692  *
23693  * have_slices, index = _unellipsify(index, self.view.ndim)
23694  */
23695  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 414, __pyx_L1_error)
23696  __Pyx_GOTREF(__pyx_tuple__29);
23697  __Pyx_GIVEREF(__pyx_tuple__29);
23698 
23699  /* "View.MemoryView":491
23700  * result = struct.unpack(self.view.format, bytesitem)
23701  * except struct.error:
23702  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
23703  * else:
23704  * if len(self.view.format) == 1:
23705  */
23706  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 491, __pyx_L1_error)
23707  __Pyx_GOTREF(__pyx_tuple__30);
23708  __Pyx_GIVEREF(__pyx_tuple__30);
23709 
23710  /* "View.MemoryView":516
23711  * def __getbuffer__(self, Py_buffer *info, int flags):
23712  * if flags & PyBUF_WRITABLE and self.view.readonly:
23713  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
23714  *
23715  * if flags & PyBUF_ND:
23716  */
23717  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 516, __pyx_L1_error)
23718  __Pyx_GOTREF(__pyx_tuple__31);
23719  __Pyx_GIVEREF(__pyx_tuple__31);
23720 
23721  /* "View.MemoryView":566
23722  * if self.view.strides == NULL:
23723  *
23724  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
23725  *
23726  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
23727  */
23728  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 566, __pyx_L1_error)
23729  __Pyx_GOTREF(__pyx_tuple__32);
23730  __Pyx_GIVEREF(__pyx_tuple__32);
23731 
23732  /* "View.MemoryView":573
23733  * def suboffsets(self):
23734  * if self.view.suboffsets == NULL:
23735  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
23736  *
23737  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
23738  */
23739  __pyx_tuple__33 = PyTuple_New(1); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 573, __pyx_L1_error)
23740  __Pyx_GOTREF(__pyx_tuple__33);
23741  __Pyx_INCREF(__pyx_int_neg_1);
23742  __Pyx_GIVEREF(__pyx_int_neg_1);
23743  PyTuple_SET_ITEM(__pyx_tuple__33, 0, __pyx_int_neg_1);
23744  __Pyx_GIVEREF(__pyx_tuple__33);
23745 
23746  /* "(tree fragment)":2
23747  * def __reduce_cython__(self):
23748  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23749  * def __setstate_cython__(self, __pyx_state):
23750  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23751  */
23752  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 2, __pyx_L1_error)
23753  __Pyx_GOTREF(__pyx_tuple__34);
23754  __Pyx_GIVEREF(__pyx_tuple__34);
23755 
23756  /* "(tree fragment)":4
23757  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23758  * def __setstate_cython__(self, __pyx_state):
23759  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23760  */
23761  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 4, __pyx_L1_error)
23762  __Pyx_GOTREF(__pyx_tuple__35);
23763  __Pyx_GIVEREF(__pyx_tuple__35);
23764 
23765  /* "View.MemoryView":699
23766  * for suboffset in suboffsets[:ndim]:
23767  * if suboffset >= 0:
23768  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
23769  *
23770  *
23771  */
23772  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 699, __pyx_L1_error)
23773  __Pyx_GOTREF(__pyx_tuple__36);
23774  __Pyx_GIVEREF(__pyx_tuple__36);
23775 
23776  /* "(tree fragment)":2
23777  * def __reduce_cython__(self):
23778  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23779  * def __setstate_cython__(self, __pyx_state):
23780  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23781  */
23782  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 2, __pyx_L1_error)
23783  __Pyx_GOTREF(__pyx_tuple__37);
23784  __Pyx_GIVEREF(__pyx_tuple__37);
23785 
23786  /* "(tree fragment)":4
23787  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23788  * def __setstate_cython__(self, __pyx_state):
23789  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23790  */
23791  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 4, __pyx_L1_error)
23792  __Pyx_GOTREF(__pyx_tuple__38);
23793  __Pyx_GIVEREF(__pyx_tuple__38);
23794 
23795  /* "BoundaryConditions.py":52
23796  * # setattr(BC_Base, name, default_value)
23797  *
23798  * def getContext(self, context=None): # <<<<<<<<<<<<<<
23799  * """
23800  * Gets context from proteus.Context or
23801  */
23802  __pyx_tuple__40 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_Context); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 52, __pyx_L1_error)
23803  __Pyx_GOTREF(__pyx_tuple__40);
23804  __Pyx_GIVEREF(__pyx_tuple__40);
23805  __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_getContext, 52, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 52, __pyx_L1_error)
23806 
23807  /* "(tree fragment)":1
23808  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
23809  * cdef tuple state
23810  * cdef object _dict
23811  */
23812  __pyx_tuple__41 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(1, 1, __pyx_L1_error)
23813  __Pyx_GOTREF(__pyx_tuple__41);
23814  __Pyx_GIVEREF(__pyx_tuple__41);
23815  __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(1, 1, __pyx_L1_error)
23816 
23817  /* "(tree fragment)":16
23818  * else:
23819  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
23820  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
23821  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state)
23822  */
23823  __pyx_tuple__42 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(1, 16, __pyx_L1_error)
23824  __Pyx_GOTREF(__pyx_tuple__42);
23825  __Pyx_GIVEREF(__pyx_tuple__42);
23826  __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(1, 16, __pyx_L1_error)
23827 
23828  /* "BoundaryConditions.py":81
23829  * self.uOfXT = None
23830  *
23831  * def init_cython(self): # <<<<<<<<<<<<<<
23832  * return self.uOfXT
23833  *
23834  */
23835  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 81, __pyx_L1_error)
23836  __Pyx_GOTREF(__pyx_tuple__43);
23837  __Pyx_GIVEREF(__pyx_tuple__43);
23838  __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_init_cython, 81, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 81, __pyx_L1_error)
23839 
23840  /* "BoundaryConditions.py":84
23841  * return self.uOfXT
23842  *
23843  * def resetBC(self): # <<<<<<<<<<<<<<
23844  * self.uOfXT = None
23845  *
23846  */
23847  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 84, __pyx_L1_error)
23848  __Pyx_GOTREF(__pyx_tuple__44);
23849  __Pyx_GIVEREF(__pyx_tuple__44);
23850  __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_resetBC, 84, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 84, __pyx_L1_error)
23851 
23852  /* "BoundaryConditions.py":87
23853  * self.uOfXT = None
23854  *
23855  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
23856  * """
23857  * function returning constant BC
23858  */
23859  __pyx_tuple__45 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 87, __pyx_L1_error)
23860  __Pyx_GOTREF(__pyx_tuple__45);
23861  __Pyx_GIVEREF(__pyx_tuple__45);
23862  __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_setConstantBC, 87, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 87, __pyx_L1_error)
23863 
23864  /* "BoundaryConditions.py":100
23865  *
23866  *
23867  * def setLinearBC(self, a0, a): # <<<<<<<<<<<<<<
23868  * """
23869  * function returning value=a0+ax*x+ay*y+az*z
23870  */
23871  __pyx_tuple__46 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_a0, __pyx_n_s_a); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 100, __pyx_L1_error)
23872  __Pyx_GOTREF(__pyx_tuple__46);
23873  __Pyx_GIVEREF(__pyx_tuple__46);
23874  __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_setLinearBC, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 100, __pyx_L1_error)
23875 
23876  /* "BoundaryConditions.py":115
23877  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:])
23878  *
23879  * def setLinearRamp(self,t1,value): # <<<<<<<<<<<<<<
23880  * """
23881  * function setting a linear ramp from t=0 to t=t1
23882  */
23883  __pyx_tuple__47 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_t1, __pyx_n_s_value); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 115, __pyx_L1_error)
23884  __Pyx_GOTREF(__pyx_tuple__47);
23885  __Pyx_GIVEREF(__pyx_tuple__47);
23886  __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_setLinearRamp, 115, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 115, __pyx_L1_error)
23887 
23888  /* "(tree fragment)":1
23889  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
23890  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
23891  * def __setstate_cython__(self, __pyx_state):
23892  */
23893  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 1, __pyx_L1_error)
23894  __Pyx_GOTREF(__pyx_tuple__48);
23895  __Pyx_GIVEREF(__pyx_tuple__48);
23896  __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(1, 1, __pyx_L1_error)
23897 
23898  /* "(tree fragment)":3
23899  * def __reduce_cython__(self):
23900  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
23901  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
23902  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
23903  */
23904  __pyx_tuple__49 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(1, 3, __pyx_L1_error)
23905  __Pyx_GOTREF(__pyx_tuple__49);
23906  __Pyx_GIVEREF(__pyx_tuple__49);
23907  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(1, 3, __pyx_L1_error)
23908 
23909  /* "(tree fragment)":1
23910  * def __pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
23911  * cdef object __pyx_PickleError
23912  * cdef object __pyx_result
23913  */
23914  __pyx_tuple__50 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(1, 1, __pyx_L1_error)
23915  __Pyx_GOTREF(__pyx_tuple__50);
23916  __Pyx_GIVEREF(__pyx_tuple__50);
23917  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_BC_Base, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(1, 1, __pyx_L1_error)
23918 
23919  /* "View.MemoryView":286
23920  * return self.name
23921  *
23922  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
23923  * cdef strided = Enum("<strided and direct>") # default
23924  * cdef indirect = Enum("<strided and indirect>")
23925  */
23926  __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 286, __pyx_L1_error)
23927  __Pyx_GOTREF(__pyx_tuple__51);
23928  __Pyx_GIVEREF(__pyx_tuple__51);
23929 
23930  /* "View.MemoryView":287
23931  *
23932  * cdef generic = Enum("<strided and direct or indirect>")
23933  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
23934  * cdef indirect = Enum("<strided and indirect>")
23935  *
23936  */
23937  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 287, __pyx_L1_error)
23938  __Pyx_GOTREF(__pyx_tuple__52);
23939  __Pyx_GIVEREF(__pyx_tuple__52);
23940 
23941  /* "View.MemoryView":288
23942  * cdef generic = Enum("<strided and direct or indirect>")
23943  * cdef strided = Enum("<strided and direct>") # default
23944  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
23945  *
23946  *
23947  */
23948  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(1, 288, __pyx_L1_error)
23949  __Pyx_GOTREF(__pyx_tuple__53);
23950  __Pyx_GIVEREF(__pyx_tuple__53);
23951 
23952  /* "View.MemoryView":291
23953  *
23954  *
23955  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
23956  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
23957  *
23958  */
23959  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(1, 291, __pyx_L1_error)
23960  __Pyx_GOTREF(__pyx_tuple__54);
23961  __Pyx_GIVEREF(__pyx_tuple__54);
23962 
23963  /* "View.MemoryView":292
23964  *
23965  * cdef contiguous = Enum("<contiguous and direct>")
23966  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
23967  *
23968  *
23969  */
23970  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(1, 292, __pyx_L1_error)
23971  __Pyx_GOTREF(__pyx_tuple__55);
23972  __Pyx_GIVEREF(__pyx_tuple__55);
23973 
23974  /* "(tree fragment)":1
23975  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
23976  * cdef object __pyx_PickleError
23977  * cdef object __pyx_result
23978  */
23979  __pyx_tuple__56 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(1, 1, __pyx_L1_error)
23980  __Pyx_GOTREF(__pyx_tuple__56);
23981  __Pyx_GIVEREF(__pyx_tuple__56);
23982  __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(1, 1, __pyx_L1_error)
23983  __Pyx_RefNannyFinishContext();
23984  return 0;
23985  __pyx_L1_error:;
23986  __Pyx_RefNannyFinishContext();
23987  return -1;
23988 }
23989 
23990 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
23991  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23992  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
23993  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23994  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
23995  __pyx_int_158231071 = PyInt_FromLong(158231071L); if (unlikely(!__pyx_int_158231071)) __PYX_ERR(0, 1, __pyx_L1_error)
23996  __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
23997  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23998  return 0;
23999  __pyx_L1_error:;
24000  return -1;
24001 }
24002 
24003 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
24004 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
24005 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
24006 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
24007 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
24008 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
24009 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
24010 
24011 static int __Pyx_modinit_global_init_code(void) {
24012  __Pyx_RefNannyDeclarations
24013  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
24014  /*--- Global init code ---*/
24015  generic = Py_None; Py_INCREF(Py_None);
24016  strided = Py_None; Py_INCREF(Py_None);
24017  indirect = Py_None; Py_INCREF(Py_None);
24018  contiguous = Py_None; Py_INCREF(Py_None);
24019  indirect_contiguous = Py_None; Py_INCREF(Py_None);
24020  __Pyx_RefNannyFinishContext();
24021  return 0;
24022 }
24023 
24024 static int __Pyx_modinit_variable_export_code(void) {
24025  __Pyx_RefNannyDeclarations
24026  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
24027  /*--- Variable export code ---*/
24028  __Pyx_RefNannyFinishContext();
24029  return 0;
24030 }
24031 
24032 static int __Pyx_modinit_function_export_code(void) {
24033  __Pyx_RefNannyDeclarations
24034  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
24035  /*--- Function export code ---*/
24036  __Pyx_RefNannyFinishContext();
24037  return 0;
24038 }
24039 
24040 static int __Pyx_modinit_type_init_code(void) {
24041  __Pyx_RefNannyDeclarations
24042  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
24043  /*--- Type init code ---*/
24044  if (PyType_Ready(&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
24045  __pyx_type_18BoundaryConditions_BC_Base.tp_print = 0;
24046  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions_BC_Base.tp_dictoffset && __pyx_type_18BoundaryConditions_BC_Base.tp_getattro == PyObject_GenericGetAttr)) {
24047  __pyx_type_18BoundaryConditions_BC_Base.tp_getattro = __Pyx_PyObject_GenericGetAttr;
24048  }
24049  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BC_Base, (PyObject *)&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
24050  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
24051  __pyx_ptype_18BoundaryConditions_BC_Base = &__pyx_type_18BoundaryConditions_BC_Base;
24052  __pyx_vtabptr_18BoundaryConditions_BoundaryCondition = &__pyx_vtable_18BoundaryConditions_BoundaryCondition;
24053  __pyx_vtable_18BoundaryConditions_BoundaryCondition.resetBC = (void (*)(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *, int __pyx_skip_dispatch))__pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC;
24054  if (PyType_Ready(&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
24055  __pyx_type_18BoundaryConditions_BoundaryCondition.tp_print = 0;
24056  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions_BoundaryCondition.tp_dictoffset && __pyx_type_18BoundaryConditions_BoundaryCondition.tp_getattro == PyObject_GenericGetAttr)) {
24057  __pyx_type_18BoundaryConditions_BoundaryCondition.tp_getattro = __Pyx_PyObject_GenericGetAttr;
24058  }
24059  if (__Pyx_SetVtable(__pyx_type_18BoundaryConditions_BoundaryCondition.tp_dict, __pyx_vtabptr_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
24060  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BoundaryCondition, (PyObject *)&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
24061  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
24062  __pyx_ptype_18BoundaryConditions_BoundaryCondition = &__pyx_type_18BoundaryConditions_BoundaryCondition;
24063  if (PyType_Ready(&__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC) < 0) __PYX_ERR(0, 87, __pyx_L1_error)
24064  __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_print = 0;
24065  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_dictoffset && __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_getattro == PyObject_GenericGetAttr)) {
24066  __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
24067  }
24068  __pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC = &__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC;
24069  if (PyType_Ready(&__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
24070  __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_print = 0;
24071  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_dictoffset && __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_getattro == PyObject_GenericGetAttr)) {
24072  __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
24073  }
24074  __pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = &__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC;
24075  if (PyType_Ready(&__pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp) < 0) __PYX_ERR(0, 115, __pyx_L1_error)
24076  __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_print = 0;
24077  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_dictoffset && __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_getattro == PyObject_GenericGetAttr)) {
24078  __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
24079  }
24080  __pyx_ptype_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = &__pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp;
24081  __pyx_vtabptr_array = &__pyx_vtable_array;
24082  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
24083  if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
24084  __pyx_type___pyx_array.tp_print = 0;
24085  if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
24086  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
24087  __pyx_array_type = &__pyx_type___pyx_array;
24088  if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
24089  __pyx_type___pyx_MemviewEnum.tp_print = 0;
24090  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
24091  __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
24092  }
24093  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
24094  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
24095  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
24096  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
24097  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
24098  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
24099  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
24100  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
24101  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
24102  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
24103  if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
24104  __pyx_type___pyx_memoryview.tp_print = 0;
24105  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
24106  __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
24107  }
24108  if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
24109  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
24110  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
24111  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
24112  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
24113  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
24114  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
24115  __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
24116  if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 961, __pyx_L1_error)
24117  __pyx_type___pyx_memoryviewslice.tp_print = 0;
24118  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
24119  __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
24120  }
24121  if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 961, __pyx_L1_error)
24122  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 961, __pyx_L1_error)
24123  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
24124  __Pyx_RefNannyFinishContext();
24125  return 0;
24126  __pyx_L1_error:;
24127  __Pyx_RefNannyFinishContext();
24128  return -1;
24129 }
24130 
24131 static int __Pyx_modinit_type_import_code(void) {
24132  __Pyx_RefNannyDeclarations
24133  PyObject *__pyx_t_1 = NULL;
24134  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
24135  /*--- Type import code ---*/
24136  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 9, __pyx_L1_error)
24137  __Pyx_GOTREF(__pyx_t_1);
24138  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
24139  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24140  sizeof(PyTypeObject),
24141  #else
24142  sizeof(PyHeapTypeObject),
24143  #endif
24144  __Pyx_ImportType_CheckSize_Warn);
24145  if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(4, 9, __pyx_L1_error)
24146  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24147  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 206, __pyx_L1_error)
24148  __Pyx_GOTREF(__pyx_t_1);
24149  __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
24150  if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(3, 206, __pyx_L1_error)
24151  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Warn);
24152  if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(3, 229, __pyx_L1_error)
24153  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Warn);
24154  if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(3, 233, __pyx_L1_error)
24155  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
24156  if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(3, 242, __pyx_L1_error)
24157  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Warn);
24158  if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(3, 918, __pyx_L1_error)
24159  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24160  __Pyx_RefNannyFinishContext();
24161  return 0;
24162  __pyx_L1_error:;
24163  __Pyx_XDECREF(__pyx_t_1);
24164  __Pyx_RefNannyFinishContext();
24165  return -1;
24166 }
24167 
24168 static int __Pyx_modinit_variable_import_code(void) {
24169  __Pyx_RefNannyDeclarations
24170  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
24171  /*--- Variable import code ---*/
24172  __Pyx_RefNannyFinishContext();
24173  return 0;
24174 }
24175 
24176 static int __Pyx_modinit_function_import_code(void) {
24177  __Pyx_RefNannyDeclarations
24178  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
24179  /*--- Function import code ---*/
24180  __Pyx_RefNannyFinishContext();
24181  return 0;
24182 }
24183 
24184 
24185 #if PY_MAJOR_VERSION < 3
24186 #ifdef CYTHON_NO_PYINIT_EXPORT
24187 #define __Pyx_PyMODINIT_FUNC void
24188 #else
24189 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
24190 #endif
24191 #else
24192 #ifdef CYTHON_NO_PYINIT_EXPORT
24193 #define __Pyx_PyMODINIT_FUNC PyObject *
24194 #else
24195 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
24196 #endif
24197 #endif
24198 
24199 
24200 #if PY_MAJOR_VERSION < 3
24201 __Pyx_PyMODINIT_FUNC initBoundaryConditions(void) CYTHON_SMALL_CODE; /*proto*/
24202 __Pyx_PyMODINIT_FUNC initBoundaryConditions(void)
24203 #else
24204 __Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(void) CYTHON_SMALL_CODE; /*proto*/
24205 __Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(void)
24206 #if CYTHON_PEP489_MULTI_PHASE_INIT
24207 {
24208  return PyModuleDef_Init(&__pyx_moduledef);
24209 }
24210 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
24211  #if PY_VERSION_HEX >= 0x030700A1
24212  static PY_INT64_T main_interpreter_id = -1;
24213  PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
24214  if (main_interpreter_id == -1) {
24215  main_interpreter_id = current_id;
24216  return (unlikely(current_id == -1)) ? -1 : 0;
24217  } else if (unlikely(main_interpreter_id != current_id))
24218  #else
24219  static PyInterpreterState *main_interpreter = NULL;
24220  PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
24221  if (!main_interpreter) {
24222  main_interpreter = current_interpreter;
24223  } else if (unlikely(main_interpreter != current_interpreter))
24224  #endif
24225  {
24226  PyErr_SetString(
24227  PyExc_ImportError,
24228  "Interpreter change detected - this module can only be loaded into one interpreter per process.");
24229  return -1;
24230  }
24231  return 0;
24232 }
24233 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
24234  PyObject *value = PyObject_GetAttrString(spec, from_name);
24235  int result = 0;
24236  if (likely(value)) {
24237  if (allow_none || value != Py_None) {
24238  result = PyDict_SetItemString(moddict, to_name, value);
24239  }
24240  Py_DECREF(value);
24241  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
24242  PyErr_Clear();
24243  } else {
24244  result = -1;
24245  }
24246  return result;
24247 }
24248 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
24249  PyObject *module = NULL, *moddict, *modname;
24250  if (__Pyx_check_single_interpreter())
24251  return NULL;
24252  if (__pyx_m)
24253  return __Pyx_NewRef(__pyx_m);
24254  modname = PyObject_GetAttrString(spec, "name");
24255  if (unlikely(!modname)) goto bad;
24256  module = PyModule_NewObject(modname);
24257  Py_DECREF(modname);
24258  if (unlikely(!module)) goto bad;
24259  moddict = PyModule_GetDict(module);
24260  if (unlikely(!moddict)) goto bad;
24261  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
24262  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
24263  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
24264  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
24265  return module;
24266 bad:
24267  Py_XDECREF(module);
24268  return NULL;
24269 }
24270 
24271 
24272 static CYTHON_SMALL_CODE int __pyx_pymod_exec_BoundaryConditions(PyObject *__pyx_pyinit_module)
24273 #endif
24274 #endif
24275 {
24276  __Pyx_TraceDeclarations
24277  PyObject *__pyx_t_1 = NULL;
24278  static PyThread_type_lock __pyx_t_2[8];
24279  __Pyx_RefNannyDeclarations
24280  #if CYTHON_PEP489_MULTI_PHASE_INIT
24281  if (__pyx_m) {
24282  if (__pyx_m == __pyx_pyinit_module) return 0;
24283  PyErr_SetString(PyExc_RuntimeError, "Module 'BoundaryConditions' has already been imported. Re-initialisation is not supported.");
24284  return -1;
24285  }
24286  #elif PY_MAJOR_VERSION >= 3
24287  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
24288  #endif
24289  #if CYTHON_REFNANNY
24290 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
24291 if (!__Pyx_RefNanny) {
24292  PyErr_Clear();
24293  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
24294  if (!__Pyx_RefNanny)
24295  Py_FatalError("failed to import 'refnanny' module");
24296 }
24297 #endif
24298  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(void)", 0);
24299  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24300  #ifdef __Pxy_PyFrame_Initialize_Offsets
24301  __Pxy_PyFrame_Initialize_Offsets();
24302  #endif
24303  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
24304  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
24305  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
24306  #ifdef __Pyx_CyFunction_USED
24307  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24308  #endif
24309  #ifdef __Pyx_FusedFunction_USED
24310  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24311  #endif
24312  #ifdef __Pyx_Coroutine_USED
24313  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24314  #endif
24315  #ifdef __Pyx_Generator_USED
24316  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24317  #endif
24318  #ifdef __Pyx_AsyncGen_USED
24319  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24320  #endif
24321  #ifdef __Pyx_StopAsyncIteration_USED
24322  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24323  #endif
24324  /*--- Library function declarations ---*/
24325  /*--- Threads initialization code ---*/
24326  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
24327  #ifdef WITH_THREAD /* Python build with threading support? */
24328  PyEval_InitThreads();
24329  #endif
24330  #endif
24331  /*--- Module creation code ---*/
24332  #if CYTHON_PEP489_MULTI_PHASE_INIT
24333  __pyx_m = __pyx_pyinit_module;
24334  Py_INCREF(__pyx_m);
24335  #else
24336  #if PY_MAJOR_VERSION < 3
24337  __pyx_m = Py_InitModule4("BoundaryConditions", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
24338  #else
24339  __pyx_m = PyModule_Create(&__pyx_moduledef);
24340  #endif
24341  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
24342  #endif
24343  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
24344  Py_INCREF(__pyx_d);
24345  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
24346  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
24347  #if CYTHON_COMPILING_IN_PYPY
24348  Py_INCREF(__pyx_b);
24349  #endif
24350  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
24351  /*--- Initialize various global constants etc. ---*/
24352  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24353  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
24354  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24355  #endif
24356  if (__pyx_module_is_main_BoundaryConditions) {
24357  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24358  }
24359  #if PY_MAJOR_VERSION >= 3
24360  {
24361  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
24362  if (!PyDict_GetItemString(modules, "BoundaryConditions")) {
24363  if (unlikely(PyDict_SetItemString(modules, "BoundaryConditions", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
24364  }
24365  }
24366  #endif
24367  /*--- Builtin init code ---*/
24368  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24369  /*--- Constants init code ---*/
24370  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24371  /*--- Global type/function init code ---*/
24372  (void)__Pyx_modinit_global_init_code();
24373  (void)__Pyx_modinit_variable_export_code();
24374  (void)__Pyx_modinit_function_export_code();
24375  if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
24376  if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
24377  (void)__Pyx_modinit_variable_import_code();
24378  (void)__Pyx_modinit_function_import_code();
24379  /*--- Execution code ---*/
24380  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
24381  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24382  #endif
24383  __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));
24384 
24385  /* "BoundaryConditions.py":9
24386  *
24387  * import cython
24388  * import numpy as np # <<<<<<<<<<<<<<
24389  * """
24390  * Module for creating boundary conditions. Imported in SpatialTools.py
24391  */
24392  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
24393  __Pyx_GOTREF(__pyx_t_1);
24394  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
24395  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24396 
24397  /* "BoundaryConditions.py":17
24398  * """
24399  *
24400  * __all__ = ['BC_Base', # <<<<<<<<<<<<<<
24401  * 'BoundaryCondition']
24402  *
24403  */
24404  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
24405  __Pyx_GOTREF(__pyx_t_1);
24406  __Pyx_INCREF(__pyx_n_s_BC_Base);
24407  __Pyx_GIVEREF(__pyx_n_s_BC_Base);
24408  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_BC_Base);
24409  __Pyx_INCREF(__pyx_n_s_BoundaryCondition);
24410  __Pyx_GIVEREF(__pyx_n_s_BoundaryCondition);
24411  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_BoundaryCondition);
24412  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
24413  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24414 
24415  /* "BoundaryConditions.py":52
24416  * # setattr(BC_Base, name, default_value)
24417  *
24418  * def getContext(self, context=None): # <<<<<<<<<<<<<<
24419  * """
24420  * Gets context from proteus.Context or
24421  */
24422  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_7BC_Base_3getContext, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base_getContext, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj_)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error)
24423  __Pyx_GOTREF(__pyx_t_1);
24424  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base->tp_dict, __pyx_n_s_getContext, __pyx_t_1) < 0) __PYX_ERR(0, 52, __pyx_L1_error)
24425  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24426  PyType_Modified(__pyx_ptype_18BoundaryConditions_BC_Base);
24427 
24428  /* "(tree fragment)":1
24429  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
24430  * cdef tuple state
24431  * cdef object _dict
24432  */
24433  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_7BC_Base_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base___reduce_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
24434  __Pyx_GOTREF(__pyx_t_1);
24435  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24436  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24437 
24438  /* "(tree fragment)":16
24439  * else:
24440  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
24441  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
24442  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state)
24443  */
24444  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_7BC_Base_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base___setstate_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error)
24445  __Pyx_GOTREF(__pyx_t_1);
24446  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 16, __pyx_L1_error)
24447  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24448 
24449  /* "BoundaryConditions.py":81
24450  * self.uOfXT = None
24451  *
24452  * def init_cython(self): # <<<<<<<<<<<<<<
24453  * return self.uOfXT
24454  *
24455  */
24456  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_3init_cython, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_init_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error)
24457  __Pyx_GOTREF(__pyx_t_1);
24458  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_init_cython, __pyx_t_1) < 0) __PYX_ERR(0, 81, __pyx_L1_error)
24459  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24460  PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
24461 
24462  /* "BoundaryConditions.py":84
24463  * return self.uOfXT
24464  *
24465  * def resetBC(self): # <<<<<<<<<<<<<<
24466  * self.uOfXT = None
24467  *
24468  */
24469  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_5resetBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_resetBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
24470  __Pyx_GOTREF(__pyx_t_1);
24471  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_resetBC, __pyx_t_1) < 0) __PYX_ERR(0, 84, __pyx_L1_error)
24472  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24473  PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
24474 
24475  /* "BoundaryConditions.py":87
24476  * self.uOfXT = None
24477  *
24478  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
24479  * """
24480  * function returning constant BC
24481  */
24482  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_7setConstantBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_setConstantBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
24483  __Pyx_GOTREF(__pyx_t_1);
24484  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_setConstantBC, __pyx_t_1) < 0) __PYX_ERR(0, 87, __pyx_L1_error)
24485  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24486  PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
24487 
24488  /* "BoundaryConditions.py":100
24489  *
24490  *
24491  * def setLinearBC(self, a0, a): # <<<<<<<<<<<<<<
24492  * """
24493  * function returning value=a0+ax*x+ay*y+az*z
24494  */
24495  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_9setLinearBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_setLinearBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)
24496  __Pyx_GOTREF(__pyx_t_1);
24497  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_setLinearBC, __pyx_t_1) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
24498  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24499  PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
24500 
24501  /* "BoundaryConditions.py":115
24502  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:])
24503  *
24504  * def setLinearRamp(self,t1,value): # <<<<<<<<<<<<<<
24505  * """
24506  * function setting a linear ramp from t=0 to t=t1
24507  */
24508  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearRamp, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_setLinearRamp, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error)
24509  __Pyx_GOTREF(__pyx_t_1);
24510  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_setLinearRamp, __pyx_t_1) < 0) __PYX_ERR(0, 115, __pyx_L1_error)
24511  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24512  PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
24513 
24514  /* "(tree fragment)":1
24515  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
24516  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
24517  * def __setstate_cython__(self, __pyx_state):
24518  */
24519  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition___reduce_cytho, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
24520  __Pyx_GOTREF(__pyx_t_1);
24521  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24522  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24523 
24524  /* "(tree fragment)":3
24525  * def __reduce_cython__(self):
24526  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
24527  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
24528  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
24529  */
24530  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition___setstate_cyt, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
24531  __Pyx_GOTREF(__pyx_t_1);
24532  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
24533  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24534 
24535  /* "(tree fragment)":1
24536  * def __pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
24537  * cdef object __pyx_PickleError
24538  * cdef object __pyx_result
24539  */
24540  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_1__pyx_unpickle_BC_Base, 0, __pyx_n_s_pyx_unpickle_BC_Base, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
24541  __Pyx_GOTREF(__pyx_t_1);
24542  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_BC_Base, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24543  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24544 
24545  /* "BoundaryConditions.py":1
24546  * #!python # <<<<<<<<<<<<<<
24547  * # distutils: language = c++
24548  * # cython: profile=True, binding=True, embedsignature=True
24549  */
24550  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
24551  __Pyx_GOTREF(__pyx_t_1);
24552  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24553  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24554 
24555  /* "View.MemoryView":209
24556  * info.obj = self
24557  *
24558  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
24559  *
24560  * def __dealloc__(array self):
24561  */
24562  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 209, __pyx_L1_error)
24563  __Pyx_GOTREF(__pyx_t_1);
24564  if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 209, __pyx_L1_error)
24565  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24566  PyType_Modified(__pyx_array_type);
24567 
24568  /* "View.MemoryView":286
24569  * return self.name
24570  *
24571  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
24572  * cdef strided = Enum("<strided and direct>") # default
24573  * cdef indirect = Enum("<strided and indirect>")
24574  */
24575  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error)
24576  __Pyx_GOTREF(__pyx_t_1);
24577  __Pyx_XGOTREF(generic);
24578  __Pyx_DECREF_SET(generic, __pyx_t_1);
24579  __Pyx_GIVEREF(__pyx_t_1);
24580  __pyx_t_1 = 0;
24581 
24582  /* "View.MemoryView":287
24583  *
24584  * cdef generic = Enum("<strided and direct or indirect>")
24585  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
24586  * cdef indirect = Enum("<strided and indirect>")
24587  *
24588  */
24589  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
24590  __Pyx_GOTREF(__pyx_t_1);
24591  __Pyx_XGOTREF(strided);
24592  __Pyx_DECREF_SET(strided, __pyx_t_1);
24593  __Pyx_GIVEREF(__pyx_t_1);
24594  __pyx_t_1 = 0;
24595 
24596  /* "View.MemoryView":288
24597  * cdef generic = Enum("<strided and direct or indirect>")
24598  * cdef strided = Enum("<strided and direct>") # default
24599  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
24600  *
24601  *
24602  */
24603  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error)
24604  __Pyx_GOTREF(__pyx_t_1);
24605  __Pyx_XGOTREF(indirect);
24606  __Pyx_DECREF_SET(indirect, __pyx_t_1);
24607  __Pyx_GIVEREF(__pyx_t_1);
24608  __pyx_t_1 = 0;
24609 
24610  /* "View.MemoryView":291
24611  *
24612  *
24613  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
24614  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
24615  *
24616  */
24617  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error)
24618  __Pyx_GOTREF(__pyx_t_1);
24619  __Pyx_XGOTREF(contiguous);
24620  __Pyx_DECREF_SET(contiguous, __pyx_t_1);
24621  __Pyx_GIVEREF(__pyx_t_1);
24622  __pyx_t_1 = 0;
24623 
24624  /* "View.MemoryView":292
24625  *
24626  * cdef contiguous = Enum("<contiguous and direct>")
24627  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
24628  *
24629  *
24630  */
24631  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
24632  __Pyx_GOTREF(__pyx_t_1);
24633  __Pyx_XGOTREF(indirect_contiguous);
24634  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
24635  __Pyx_GIVEREF(__pyx_t_1);
24636  __pyx_t_1 = 0;
24637 
24638  /* "View.MemoryView":316
24639  *
24640  * DEF THREAD_LOCKS_PREALLOCATED = 8
24641  * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
24642  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
24643  * PyThread_allocate_lock(),
24644  */
24645  __pyx_memoryview_thread_locks_used = 0;
24646 
24647  /* "View.MemoryView":317
24648  * DEF THREAD_LOCKS_PREALLOCATED = 8
24649  * cdef int __pyx_memoryview_thread_locks_used = 0
24650  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
24651  * PyThread_allocate_lock(),
24652  * PyThread_allocate_lock(),
24653  */
24654  __pyx_t_2[0] = PyThread_allocate_lock();
24655  __pyx_t_2[1] = PyThread_allocate_lock();
24656  __pyx_t_2[2] = PyThread_allocate_lock();
24657  __pyx_t_2[3] = PyThread_allocate_lock();
24658  __pyx_t_2[4] = PyThread_allocate_lock();
24659  __pyx_t_2[5] = PyThread_allocate_lock();
24660  __pyx_t_2[6] = PyThread_allocate_lock();
24661  __pyx_t_2[7] = PyThread_allocate_lock();
24662  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
24663 
24664  /* "View.MemoryView":545
24665  * info.obj = self
24666  *
24667  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
24668  *
24669  *
24670  */
24671  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 545, __pyx_L1_error)
24672  __Pyx_GOTREF(__pyx_t_1);
24673  if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 545, __pyx_L1_error)
24674  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24675  PyType_Modified(__pyx_memoryview_type);
24676 
24677  /* "View.MemoryView":991
24678  * return self.from_object
24679  *
24680  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
24681  *
24682  *
24683  */
24684  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 991, __pyx_L1_error)
24685  __Pyx_GOTREF(__pyx_t_1);
24686  if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 991, __pyx_L1_error)
24687  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24688  PyType_Modified(__pyx_memoryviewslice_type);
24689 
24690  /* "(tree fragment)":1
24691  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
24692  * cdef object __pyx_PickleError
24693  * cdef object __pyx_result
24694  */
24695  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
24696  __Pyx_GOTREF(__pyx_t_1);
24697  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24698  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24699 
24700  /* "(tree fragment)":11
24701  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
24702  * return __pyx_result
24703  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
24704  * __pyx_result.name = __pyx_state[0]
24705  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
24706  */
24707  __Pyx_TraceReturn(Py_None, 0);
24708 
24709  /*--- Wrapped vars code ---*/
24710 
24711  goto __pyx_L0;
24712  __pyx_L1_error:;
24713  __Pyx_XDECREF(__pyx_t_1);
24714  if (__pyx_m) {
24715  if (__pyx_d) {
24716  __Pyx_AddTraceback("init BoundaryConditions", __pyx_clineno, __pyx_lineno, __pyx_filename);
24717  }
24718  Py_CLEAR(__pyx_m);
24719  } else if (!PyErr_Occurred()) {
24720  PyErr_SetString(PyExc_ImportError, "init BoundaryConditions");
24721  }
24722  __pyx_L0:;
24723  __Pyx_RefNannyFinishContext();
24724  #if CYTHON_PEP489_MULTI_PHASE_INIT
24725  return (__pyx_m != NULL) ? 0 : -1;
24726  #elif PY_MAJOR_VERSION >= 3
24727  return __pyx_m;
24728  #else
24729  return;
24730  #endif
24731 }
24732 
24733 /* --- Runtime support code --- */
24734 /* Refnanny */
24735 #if CYTHON_REFNANNY
24736 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
24737  PyObject *m = NULL, *p = NULL;
24738  void *r = NULL;
24739  m = PyImport_ImportModule(modname);
24740  if (!m) goto end;
24741  p = PyObject_GetAttrString(m, "RefNannyAPI");
24742  if (!p) goto end;
24743  r = PyLong_AsVoidPtr(p);
24744 end:
24745  Py_XDECREF(p);
24746  Py_XDECREF(m);
24747  return (__Pyx_RefNannyAPIStruct *)r;
24748 }
24749 #endif
24750 
24751 /* PyObjectGetAttrStr */
24752 #if CYTHON_USE_TYPE_SLOTS
24753 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
24754  PyTypeObject* tp = Py_TYPE(obj);
24755  if (likely(tp->tp_getattro))
24756  return tp->tp_getattro(obj, attr_name);
24757 #if PY_MAJOR_VERSION < 3
24758  if (likely(tp->tp_getattr))
24759  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
24760 #endif
24761  return PyObject_GetAttr(obj, attr_name);
24762 }
24763 #endif
24764 
24765 /* GetBuiltinName */
24766 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
24767  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
24768  if (unlikely(!result)) {
24769  PyErr_Format(PyExc_NameError,
24770 #if PY_MAJOR_VERSION >= 3
24771  "name '%U' is not defined", name);
24772 #else
24773  "name '%.200s' is not defined", PyString_AS_STRING(name));
24774 #endif
24775  }
24776  return result;
24777 }
24778 
24779 /* RaiseDoubleKeywords */
24780 static void __Pyx_RaiseDoubleKeywordsError(
24781  const char* func_name,
24782  PyObject* kw_name)
24783 {
24784  PyErr_Format(PyExc_TypeError,
24785  #if PY_MAJOR_VERSION >= 3
24786  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
24787  #else
24788  "%s() got multiple values for keyword argument '%s'", func_name,
24789  PyString_AsString(kw_name));
24790  #endif
24791 }
24792 
24793 /* ParseKeywords */
24794 static int __Pyx_ParseOptionalKeywords(
24795  PyObject *kwds,
24796  PyObject **argnames[],
24797  PyObject *kwds2,
24798  PyObject *values[],
24799  Py_ssize_t num_pos_args,
24800  const char* function_name)
24801 {
24802  PyObject *key = 0, *value = 0;
24803  Py_ssize_t pos = 0;
24804  PyObject*** name;
24805  PyObject*** first_kw_arg = argnames + num_pos_args;
24806  while (PyDict_Next(kwds, &pos, &key, &value)) {
24807  name = first_kw_arg;
24808  while (*name && (**name != key)) name++;
24809  if (*name) {
24810  values[name-argnames] = value;
24811  continue;
24812  }
24813  name = first_kw_arg;
24814  #if PY_MAJOR_VERSION < 3
24815  if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
24816  while (*name) {
24817  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
24818  && _PyString_Eq(**name, key)) {
24819  values[name-argnames] = value;
24820  break;
24821  }
24822  name++;
24823  }
24824  if (*name) continue;
24825  else {
24826  PyObject*** argname = argnames;
24827  while (argname != first_kw_arg) {
24828  if ((**argname == key) || (
24829  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
24830  && _PyString_Eq(**argname, key))) {
24831  goto arg_passed_twice;
24832  }
24833  argname++;
24834  }
24835  }
24836  } else
24837  #endif
24838  if (likely(PyUnicode_Check(key))) {
24839  while (*name) {
24840  int cmp = (**name == key) ? 0 :
24841  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24842  (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
24843  #endif
24844  PyUnicode_Compare(**name, key);
24845  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
24846  if (cmp == 0) {
24847  values[name-argnames] = value;
24848  break;
24849  }
24850  name++;
24851  }
24852  if (*name) continue;
24853  else {
24854  PyObject*** argname = argnames;
24855  while (argname != first_kw_arg) {
24856  int cmp = (**argname == key) ? 0 :
24857  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24858  (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
24859  #endif
24860  PyUnicode_Compare(**argname, key);
24861  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
24862  if (cmp == 0) goto arg_passed_twice;
24863  argname++;
24864  }
24865  }
24866  } else
24867  goto invalid_keyword_type;
24868  if (kwds2) {
24869  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
24870  } else {
24871  goto invalid_keyword;
24872  }
24873  }
24874  return 0;
24875 arg_passed_twice:
24876  __Pyx_RaiseDoubleKeywordsError(function_name, key);
24877  goto bad;
24878 invalid_keyword_type:
24879  PyErr_Format(PyExc_TypeError,
24880  "%.200s() keywords must be strings", function_name);
24881  goto bad;
24882 invalid_keyword:
24883  PyErr_Format(PyExc_TypeError,
24884  #if PY_MAJOR_VERSION < 3
24885  "%.200s() got an unexpected keyword argument '%.200s'",
24886  function_name, PyString_AsString(key));
24887  #else
24888  "%s() got an unexpected keyword argument '%U'",
24889  function_name, key);
24890  #endif
24891 bad:
24892  return -1;
24893 }
24894 
24895 /* RaiseArgTupleInvalid */
24896 static void __Pyx_RaiseArgtupleInvalid(
24897  const char* func_name,
24898  int exact,
24899  Py_ssize_t num_min,
24900  Py_ssize_t num_max,
24901  Py_ssize_t num_found)
24902 {
24903  Py_ssize_t num_expected;
24904  const char *more_or_less;
24905  if (num_found < num_min) {
24906  num_expected = num_min;
24907  more_or_less = "at least";
24908  } else {
24909  num_expected = num_max;
24910  more_or_less = "at most";
24911  }
24912  if (exact) {
24913  more_or_less = "exactly";
24914  }
24915  PyErr_Format(PyExc_TypeError,
24916  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
24917  func_name, more_or_less, num_expected,
24918  (num_expected == 1) ? "" : "s", num_found);
24919 }
24920 
24921 /* PyErrFetchRestore */
24922 #if CYTHON_FAST_THREAD_STATE
24923 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24924  PyObject *tmp_type, *tmp_value, *tmp_tb;
24925  tmp_type = tstate->curexc_type;
24926  tmp_value = tstate->curexc_value;
24927  tmp_tb = tstate->curexc_traceback;
24928  tstate->curexc_type = type;
24929  tstate->curexc_value = value;
24930  tstate->curexc_traceback = tb;
24931  Py_XDECREF(tmp_type);
24932  Py_XDECREF(tmp_value);
24933  Py_XDECREF(tmp_tb);
24934 }
24935 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24936  *type = tstate->curexc_type;
24937  *value = tstate->curexc_value;
24938  *tb = tstate->curexc_traceback;
24939  tstate->curexc_type = 0;
24940  tstate->curexc_value = 0;
24941  tstate->curexc_traceback = 0;
24942 }
24943 #endif
24944 
24945 /* Profile */
24946 #if CYTHON_PROFILE
24947 static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
24948  PyFrameObject** frame,
24949  PyThreadState* tstate,
24950  const char *funcname,
24951  const char *srcfile,
24952  int firstlineno) {
24953  PyObject *type, *value, *traceback;
24954  int retval;
24955  if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
24956  if (*code == NULL) {
24957  *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
24958  if (*code == NULL) return 0;
24959  }
24960  *frame = PyFrame_New(
24961  tstate, /*PyThreadState *tstate*/
24962  *code, /*PyCodeObject *code*/
24963  __pyx_d, /*PyObject *globals*/
24964  0 /*PyObject *locals*/
24965  );
24966  if (*frame == NULL) return 0;
24967  if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
24968  Py_INCREF(Py_None);
24969  (*frame)->f_trace = Py_None;
24970  }
24971 #if PY_VERSION_HEX < 0x030400B1
24972  } else {
24973  (*frame)->f_tstate = tstate;
24974 #endif
24975  }
24976  __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
24977  retval = 1;
24978  tstate->tracing++;
24979  tstate->use_tracing = 0;
24980  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
24981  #if CYTHON_TRACE
24982  if (tstate->c_tracefunc)
24983  retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
24984  if (retval && tstate->c_profilefunc)
24985  #endif
24986  retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
24987  tstate->use_tracing = (tstate->c_profilefunc ||
24988  (CYTHON_TRACE && tstate->c_tracefunc));
24989  tstate->tracing--;
24990  if (retval) {
24991  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
24992  return tstate->use_tracing && retval;
24993  } else {
24994  Py_XDECREF(type);
24995  Py_XDECREF(value);
24996  Py_XDECREF(traceback);
24997  return -1;
24998  }
24999 }
25000 static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) {
25001  PyObject *py_srcfile = 0;
25002  PyObject *py_funcname = 0;
25003  PyCodeObject *py_code = 0;
25004  #if PY_MAJOR_VERSION < 3
25005  py_funcname = PyString_FromString(funcname);
25006  py_srcfile = PyString_FromString(srcfile);
25007  #else
25008  py_funcname = PyUnicode_FromString(funcname);
25009  py_srcfile = PyUnicode_FromString(srcfile);
25010  #endif
25011  if (!py_funcname | !py_srcfile) goto bad;
25012  py_code = PyCode_New(
25013  0,
25014  #if PY_MAJOR_VERSION >= 3
25015  0,
25016  #endif
25017  0,
25018  0,
25019  CO_OPTIMIZED | CO_NEWLOCALS,
25020  __pyx_empty_bytes, /*PyObject *code,*/
25021  __pyx_empty_tuple, /*PyObject *consts,*/
25022  __pyx_empty_tuple, /*PyObject *names,*/
25023  __pyx_empty_tuple, /*PyObject *varnames,*/
25024  __pyx_empty_tuple, /*PyObject *freevars,*/
25025  __pyx_empty_tuple, /*PyObject *cellvars,*/
25026  py_srcfile, /*PyObject *filename,*/
25027  py_funcname, /*PyObject *name,*/
25028  firstlineno,
25029  __pyx_empty_bytes /*PyObject *lnotab*/
25030  );
25031 bad:
25032  Py_XDECREF(py_srcfile);
25033  Py_XDECREF(py_funcname);
25034  return py_code;
25035 }
25036 #endif
25037 
25038 /* GetItemInt */
25039 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
25040  PyObject *r;
25041  if (!j) return NULL;
25042  r = PyObject_GetItem(o, j);
25043  Py_DECREF(j);
25044  return r;
25045 }
25046 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
25047  CYTHON_NCP_UNUSED int wraparound,
25048  CYTHON_NCP_UNUSED int boundscheck) {
25049 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25050  Py_ssize_t wrapped_i = i;
25051  if (wraparound & unlikely(i < 0)) {
25052  wrapped_i += PyList_GET_SIZE(o);
25053  }
25054  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
25055  PyObject *r = PyList_GET_ITEM(o, wrapped_i);
25056  Py_INCREF(r);
25057  return r;
25058  }
25059  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25060 #else
25061  return PySequence_GetItem(o, i);
25062 #endif
25063 }
25064 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
25065  CYTHON_NCP_UNUSED int wraparound,
25066  CYTHON_NCP_UNUSED int boundscheck) {
25067 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25068  Py_ssize_t wrapped_i = i;
25069  if (wraparound & unlikely(i < 0)) {
25070  wrapped_i += PyTuple_GET_SIZE(o);
25071  }
25072  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
25073  PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
25074  Py_INCREF(r);
25075  return r;
25076  }
25077  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25078 #else
25079  return PySequence_GetItem(o, i);
25080 #endif
25081 }
25082 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
25083  CYTHON_NCP_UNUSED int wraparound,
25084  CYTHON_NCP_UNUSED int boundscheck) {
25085 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
25086  if (is_list || PyList_CheckExact(o)) {
25087  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
25088  if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
25089  PyObject *r = PyList_GET_ITEM(o, n);
25090  Py_INCREF(r);
25091  return r;
25092  }
25093  }
25094  else if (PyTuple_CheckExact(o)) {
25095  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
25096  if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
25097  PyObject *r = PyTuple_GET_ITEM(o, n);
25098  Py_INCREF(r);
25099  return r;
25100  }
25101  } else {
25102  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
25103  if (likely(m && m->sq_item)) {
25104  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
25105  Py_ssize_t l = m->sq_length(o);
25106  if (likely(l >= 0)) {
25107  i += l;
25108  } else {
25109  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
25110  return NULL;
25111  PyErr_Clear();
25112  }
25113  }
25114  return m->sq_item(o, i);
25115  }
25116  }
25117 #else
25118  if (is_list || PySequence_Check(o)) {
25119  return PySequence_GetItem(o, i);
25120  }
25121 #endif
25122  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25123 }
25124 
25125 /* ObjectGetItem */
25126 #if CYTHON_USE_TYPE_SLOTS
25127 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
25128  PyObject *runerr;
25129  Py_ssize_t key_value;
25130  PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
25131  if (unlikely(!(m && m->sq_item))) {
25132  PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
25133  return NULL;
25134  }
25135  key_value = __Pyx_PyIndex_AsSsize_t(index);
25136  if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
25137  return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
25138  }
25139  if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
25140  PyErr_Clear();
25141  PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
25142  }
25143  return NULL;
25144 }
25145 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
25146  PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
25147  if (likely(m && m->mp_subscript)) {
25148  return m->mp_subscript(obj, key);
25149  }
25150  return __Pyx_PyObject_GetIndex(obj, key);
25151 }
25152 #endif
25153 
25154 /* MemviewSliceInit */
25155 static int
25156 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
25157  int ndim,
25158  __Pyx_memviewslice *memviewslice,
25159  int memview_is_new_reference)
25160 {
25161  __Pyx_RefNannyDeclarations
25162  int i, retval=-1;
25163  Py_buffer *buf = &memview->view;
25164  __Pyx_RefNannySetupContext("init_memviewslice", 0);
25165  if (!buf) {
25166  PyErr_SetString(PyExc_ValueError,
25167  "buf is NULL.");
25168  goto fail;
25169  } else if (memviewslice->memview || memviewslice->data) {
25170  PyErr_SetString(PyExc_ValueError,
25171  "memviewslice is already initialized!");
25172  goto fail;
25173  }
25174  if (buf->strides) {
25175  for (i = 0; i < ndim; i++) {
25176  memviewslice->strides[i] = buf->strides[i];
25177  }
25178  } else {
25179  Py_ssize_t stride = buf->itemsize;
25180  for (i = ndim - 1; i >= 0; i--) {
25181  memviewslice->strides[i] = stride;
25182  stride *= buf->shape[i];
25183  }
25184  }
25185  for (i = 0; i < ndim; i++) {
25186  memviewslice->shape[i] = buf->shape[i];
25187  if (buf->suboffsets) {
25188  memviewslice->suboffsets[i] = buf->suboffsets[i];
25189  } else {
25190  memviewslice->suboffsets[i] = -1;
25191  }
25192  }
25193  memviewslice->memview = memview;
25194  memviewslice->data = (char *)buf->buf;
25195  if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
25196  Py_INCREF(memview);
25197  }
25198  retval = 0;
25199  goto no_fail;
25200 fail:
25201  memviewslice->memview = 0;
25202  memviewslice->data = 0;
25203  retval = -1;
25204 no_fail:
25205  __Pyx_RefNannyFinishContext();
25206  return retval;
25207 }
25208 #ifndef Py_NO_RETURN
25209 #define Py_NO_RETURN
25210 #endif
25211 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
25212  va_list vargs;
25213  char msg[200];
25214 #ifdef HAVE_STDARG_PROTOTYPES
25215  va_start(vargs, fmt);
25216 #else
25217  va_start(vargs);
25218 #endif
25219  vsnprintf(msg, 200, fmt, vargs);
25220  va_end(vargs);
25221  Py_FatalError(msg);
25222 }
25223 static CYTHON_INLINE int
25224 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
25225  PyThread_type_lock lock)
25226 {
25227  int result;
25228  PyThread_acquire_lock(lock, 1);
25229  result = (*acquisition_count)++;
25230  PyThread_release_lock(lock);
25231  return result;
25232 }
25233 static CYTHON_INLINE int
25234 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
25235  PyThread_type_lock lock)
25236 {
25237  int result;
25238  PyThread_acquire_lock(lock, 1);
25239  result = (*acquisition_count)--;
25240  PyThread_release_lock(lock);
25241  return result;
25242 }
25243 static CYTHON_INLINE void
25244 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
25245 {
25246  int first_time;
25247  struct __pyx_memoryview_obj *memview = memslice->memview;
25248  if (!memview || (PyObject *) memview == Py_None)
25249  return;
25250  if (__pyx_get_slice_count(memview) < 0)
25251  __pyx_fatalerror("Acquisition count is %d (line %d)",
25252  __pyx_get_slice_count(memview), lineno);
25253  first_time = __pyx_add_acquisition_count(memview) == 0;
25254  if (first_time) {
25255  if (have_gil) {
25256  Py_INCREF((PyObject *) memview);
25257  } else {
25258  PyGILState_STATE _gilstate = PyGILState_Ensure();
25259  Py_INCREF((PyObject *) memview);
25260  PyGILState_Release(_gilstate);
25261  }
25262  }
25263 }
25264 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
25265  int have_gil, int lineno) {
25266  int last_time;
25267  struct __pyx_memoryview_obj *memview = memslice->memview;
25268  if (!memview ) {
25269  return;
25270  } else if ((PyObject *) memview == Py_None) {
25271  memslice->memview = NULL;
25272  return;
25273  }
25274  if (__pyx_get_slice_count(memview) <= 0)
25275  __pyx_fatalerror("Acquisition count is %d (line %d)",
25276  __pyx_get_slice_count(memview), lineno);
25277  last_time = __pyx_sub_acquisition_count(memview) == 1;
25278  memslice->data = NULL;
25279  if (last_time) {
25280  if (have_gil) {
25281  Py_CLEAR(memslice->memview);
25282  } else {
25283  PyGILState_STATE _gilstate = PyGILState_Ensure();
25284  Py_CLEAR(memslice->memview);
25285  PyGILState_Release(_gilstate);
25286  }
25287  } else {
25288  memslice->memview = NULL;
25289  }
25290 }
25291 
25292 /* Import */
25293 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
25294  PyObject *empty_list = 0;
25295  PyObject *module = 0;
25296  PyObject *global_dict = 0;
25297  PyObject *empty_dict = 0;
25298  PyObject *list;
25299  #if PY_MAJOR_VERSION < 3
25300  PyObject *py_import;
25301  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
25302  if (!py_import)
25303  goto bad;
25304  #endif
25305  if (from_list)
25306  list = from_list;
25307  else {
25308  empty_list = PyList_New(0);
25309  if (!empty_list)
25310  goto bad;
25311  list = empty_list;
25312  }
25313  global_dict = PyModule_GetDict(__pyx_m);
25314  if (!global_dict)
25315  goto bad;
25316  empty_dict = PyDict_New();
25317  if (!empty_dict)
25318  goto bad;
25319  {
25320  #if PY_MAJOR_VERSION >= 3
25321  if (level == -1) {
25322  if (strchr(__Pyx_MODULE_NAME, '.')) {
25323  module = PyImport_ImportModuleLevelObject(
25324  name, global_dict, empty_dict, list, 1);
25325  if (!module) {
25326  if (!PyErr_ExceptionMatches(PyExc_ImportError))
25327  goto bad;
25328  PyErr_Clear();
25329  }
25330  }
25331  level = 0;
25332  }
25333  #endif
25334  if (!module) {
25335  #if PY_MAJOR_VERSION < 3
25336  PyObject *py_level = PyInt_FromLong(level);
25337  if (!py_level)
25338  goto bad;
25339  module = PyObject_CallFunctionObjArgs(py_import,
25340  name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
25341  Py_DECREF(py_level);
25342  #else
25343  module = PyImport_ImportModuleLevelObject(
25344  name, global_dict, empty_dict, list, level);
25345  #endif
25346  }
25347  }
25348 bad:
25349  #if PY_MAJOR_VERSION < 3
25350  Py_XDECREF(py_import);
25351  #endif
25352  Py_XDECREF(empty_list);
25353  Py_XDECREF(empty_dict);
25354  return module;
25355 }
25356 
25357 /* ImportFrom */
25358 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
25359  PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
25360  if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25361  PyErr_Format(PyExc_ImportError,
25362  #if PY_MAJOR_VERSION < 3
25363  "cannot import name %.230s", PyString_AS_STRING(name));
25364  #else
25365  "cannot import name %S", name);
25366  #endif
25367  }
25368  return value;
25369 }
25370 
25371 /* PyFunctionFastCall */
25372 #if CYTHON_FAST_PYCALL
25373 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
25374  PyObject *globals) {
25375  PyFrameObject *f;
25376  PyThreadState *tstate = __Pyx_PyThreadState_Current;
25377  PyObject **fastlocals;
25378  Py_ssize_t i;
25379  PyObject *result;
25380  assert(globals != NULL);
25381  /* XXX Perhaps we should create a specialized
25382  PyFrame_New() that doesn't take locals, but does
25383  take builtins without sanity checking them.
25384  */
25385  assert(tstate != NULL);
25386  f = PyFrame_New(tstate, co, globals, NULL);
25387  if (f == NULL) {
25388  return NULL;
25389  }
25390  fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
25391  for (i = 0; i < na; i++) {
25392  Py_INCREF(*args);
25393  fastlocals[i] = *args++;
25394  }
25395  result = PyEval_EvalFrameEx(f,0);
25396  ++tstate->recursion_depth;
25397  Py_DECREF(f);
25398  --tstate->recursion_depth;
25399  return result;
25400 }
25401 #if 1 || PY_VERSION_HEX < 0x030600B1
25402 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
25403  PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
25404  PyObject *globals = PyFunction_GET_GLOBALS(func);
25405  PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
25406  PyObject *closure;
25407 #if PY_MAJOR_VERSION >= 3
25408  PyObject *kwdefs;
25409 #endif
25410  PyObject *kwtuple, **k;
25411  PyObject **d;
25412  Py_ssize_t nd;
25413  Py_ssize_t nk;
25414  PyObject *result;
25415  assert(kwargs == NULL || PyDict_Check(kwargs));
25416  nk = kwargs ? PyDict_Size(kwargs) : 0;
25417  if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
25418  return NULL;
25419  }
25420  if (
25421 #if PY_MAJOR_VERSION >= 3
25422  co->co_kwonlyargcount == 0 &&
25423 #endif
25424  likely(kwargs == NULL || nk == 0) &&
25425  co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
25426  if (argdefs == NULL && co->co_argcount == nargs) {
25427  result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
25428  goto done;
25429  }
25430  else if (nargs == 0 && argdefs != NULL
25431  && co->co_argcount == Py_SIZE(argdefs)) {
25432  /* function called with no arguments, but all parameters have
25433  a default value: use default values as arguments .*/
25434  args = &PyTuple_GET_ITEM(argdefs, 0);
25435  result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
25436  goto done;
25437  }
25438  }
25439  if (kwargs != NULL) {
25440  Py_ssize_t pos, i;
25441  kwtuple = PyTuple_New(2 * nk);
25442  if (kwtuple == NULL) {
25443  result = NULL;
25444  goto done;
25445  }
25446  k = &PyTuple_GET_ITEM(kwtuple, 0);
25447  pos = i = 0;
25448  while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
25449  Py_INCREF(k[i]);
25450  Py_INCREF(k[i+1]);
25451  i += 2;
25452  }
25453  nk = i / 2;
25454  }
25455  else {
25456  kwtuple = NULL;
25457  k = NULL;
25458  }
25459  closure = PyFunction_GET_CLOSURE(func);
25460 #if PY_MAJOR_VERSION >= 3
25461  kwdefs = PyFunction_GET_KW_DEFAULTS(func);
25462 #endif
25463  if (argdefs != NULL) {
25464  d = &PyTuple_GET_ITEM(argdefs, 0);
25465  nd = Py_SIZE(argdefs);
25466  }
25467  else {
25468  d = NULL;
25469  nd = 0;
25470  }
25471 #if PY_MAJOR_VERSION >= 3
25472  result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
25473  args, nargs,
25474  k, (int)nk,
25475  d, (int)nd, kwdefs, closure);
25476 #else
25477  result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
25478  args, nargs,
25479  k, (int)nk,
25480  d, (int)nd, closure);
25481 #endif
25482  Py_XDECREF(kwtuple);
25483 done:
25484  Py_LeaveRecursiveCall();
25485  return result;
25486 }
25487 #endif
25488 #endif
25489 
25490 /* PyObjectCall */
25491 #if CYTHON_COMPILING_IN_CPYTHON
25492 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
25493  PyObject *result;
25494  ternaryfunc call = func->ob_type->tp_call;
25495  if (unlikely(!call))
25496  return PyObject_Call(func, arg, kw);
25497  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
25498  return NULL;
25499  result = (*call)(func, arg, kw);
25500  Py_LeaveRecursiveCall();
25501  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
25502  PyErr_SetString(
25503  PyExc_SystemError,
25504  "NULL result without error in PyObject_Call");
25505  }
25506  return result;
25507 }
25508 #endif
25509 
25510 /* PyObjectCallMethO */
25511 #if CYTHON_COMPILING_IN_CPYTHON
25512 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
25513  PyObject *self, *result;
25514  PyCFunction cfunc;
25515  cfunc = PyCFunction_GET_FUNCTION(func);
25516  self = PyCFunction_GET_SELF(func);
25517  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
25518  return NULL;
25519  result = cfunc(self, arg);
25520  Py_LeaveRecursiveCall();
25521  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
25522  PyErr_SetString(
25523  PyExc_SystemError,
25524  "NULL result without error in PyObject_Call");
25525  }
25526  return result;
25527 }
25528 #endif
25529 
25530 /* PyObjectCallNoArg */
25531 #if CYTHON_COMPILING_IN_CPYTHON
25532 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
25533 #if CYTHON_FAST_PYCALL
25534  if (PyFunction_Check(func)) {
25535  return __Pyx_PyFunction_FastCall(func, NULL, 0);
25536  }
25537 #endif
25538 #ifdef __Pyx_CyFunction_USED
25539  if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
25540 #else
25541  if (likely(PyCFunction_Check(func)))
25542 #endif
25543  {
25544  if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
25545  return __Pyx_PyObject_CallMethO(func, NULL);
25546  }
25547  }
25548  return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
25549 }
25550 #endif
25551 
25552 /* PyCFunctionFastCall */
25553 #if CYTHON_FAST_PYCCALL
25554 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
25555  PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
25556  PyCFunction meth = PyCFunction_GET_FUNCTION(func);
25557  PyObject *self = PyCFunction_GET_SELF(func);
25558  int flags = PyCFunction_GET_FLAGS(func);
25559  assert(PyCFunction_Check(func));
25560  assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
25561  assert(nargs >= 0);
25562  assert(nargs == 0 || args != NULL);
25563  /* _PyCFunction_FastCallDict() must not be called with an exception set,
25564  because it may clear it (directly or indirectly) and so the
25565  caller loses its exception */
25566  assert(!PyErr_Occurred());
25567  if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
25568  return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
25569  } else {
25570  return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
25571  }
25572 }
25573 #endif
25574 
25575 /* PyObjectCallOneArg */
25576 #if CYTHON_COMPILING_IN_CPYTHON
25577 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
25578  PyObject *result;
25579  PyObject *args = PyTuple_New(1);
25580  if (unlikely(!args)) return NULL;
25581  Py_INCREF(arg);
25582  PyTuple_SET_ITEM(args, 0, arg);
25583  result = __Pyx_PyObject_Call(func, args, NULL);
25584  Py_DECREF(args);
25585  return result;
25586 }
25587 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
25588 #if CYTHON_FAST_PYCALL
25589  if (PyFunction_Check(func)) {
25590  return __Pyx_PyFunction_FastCall(func, &arg, 1);
25591  }
25592 #endif
25593  if (likely(PyCFunction_Check(func))) {
25594  if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
25595  return __Pyx_PyObject_CallMethO(func, arg);
25596 #if CYTHON_FAST_PYCCALL
25597  } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
25598  return __Pyx_PyCFunction_FastCall(func, &arg, 1);
25599 #endif
25600  }
25601  }
25602  return __Pyx__PyObject_CallOneArg(func, arg);
25603 }
25604 #else
25605 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
25606  PyObject *result;
25607  PyObject *args = PyTuple_Pack(1, arg);
25608  if (unlikely(!args)) return NULL;
25609  result = __Pyx_PyObject_Call(func, args, NULL);
25610  Py_DECREF(args);
25611  return result;
25612 }
25613 #endif
25614 
25615 /* PyErrExceptionMatches */
25616 #if CYTHON_FAST_THREAD_STATE
25617 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25618  Py_ssize_t i, n;
25619  n = PyTuple_GET_SIZE(tuple);
25620 #if PY_MAJOR_VERSION >= 3
25621  for (i=0; i<n; i++) {
25622  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
25623  }
25624 #endif
25625  for (i=0; i<n; i++) {
25626  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
25627  }
25628  return 0;
25629 }
25630 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
25631  PyObject *exc_type = tstate->curexc_type;
25632  if (exc_type == err) return 1;
25633  if (unlikely(!exc_type)) return 0;
25634  if (unlikely(PyTuple_Check(err)))
25635  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
25636  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
25637 }
25638 #endif
25639 
25640 /* GetAttr */
25641 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
25642 #if CYTHON_USE_TYPE_SLOTS
25643 #if PY_MAJOR_VERSION >= 3
25644  if (likely(PyUnicode_Check(n)))
25645 #else
25646  if (likely(PyString_Check(n)))
25647 #endif
25648  return __Pyx_PyObject_GetAttrStr(o, n);
25649 #endif
25650  return PyObject_GetAttr(o, n);
25651 }
25652 
25653 /* GetAttr3 */
25654 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
25655  __Pyx_PyThreadState_declare
25656  __Pyx_PyThreadState_assign
25657  if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25658  return NULL;
25659  __Pyx_PyErr_Clear();
25660  Py_INCREF(d);
25661  return d;
25662 }
25663 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
25664  PyObject *r = __Pyx_GetAttr(o, n);
25665  return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
25666 }
25667 
25668 /* GetModuleGlobalName */
25669 #if CYTHON_USE_DICT_VERSIONS
25670 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
25671 #else
25672 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
25673 #endif
25674 {
25675  PyObject *result;
25676 #if !CYTHON_AVOID_BORROWED_REFS
25677 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
25678  result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
25679  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
25680  if (likely(result)) {
25681  return __Pyx_NewRef(result);
25682  } else if (unlikely(PyErr_Occurred())) {
25683  return NULL;
25684  }
25685 #else
25686  result = PyDict_GetItem(__pyx_d, name);
25687  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
25688  if (likely(result)) {
25689  return __Pyx_NewRef(result);
25690  }
25691 #endif
25692 #else
25693  result = PyObject_GetItem(__pyx_d, name);
25694  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
25695  if (likely(result)) {
25696  return __Pyx_NewRef(result);
25697  }
25698  PyErr_Clear();
25699 #endif
25700  return __Pyx_GetBuiltinName(name);
25701 }
25702 
25703 /* KeywordStringCheck */
25704 static int __Pyx_CheckKeywordStrings(
25705  PyObject *kwdict,
25706  const char* function_name,
25707  int kw_allowed)
25708 {
25709  PyObject* key = 0;
25710  Py_ssize_t pos = 0;
25711 #if CYTHON_COMPILING_IN_PYPY
25712  if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
25713  goto invalid_keyword;
25714  return 1;
25715 #else
25716  while (PyDict_Next(kwdict, &pos, &key, 0)) {
25717  #if PY_MAJOR_VERSION < 3
25718  if (unlikely(!PyString_Check(key)))
25719  #endif
25720  if (unlikely(!PyUnicode_Check(key)))
25721  goto invalid_keyword_type;
25722  }
25723  if ((!kw_allowed) && unlikely(key))
25724  goto invalid_keyword;
25725  return 1;
25726 invalid_keyword_type:
25727  PyErr_Format(PyExc_TypeError,
25728  "%.200s() keywords must be strings", function_name);
25729  return 0;
25730 #endif
25731 invalid_keyword:
25732  PyErr_Format(PyExc_TypeError,
25733  #if PY_MAJOR_VERSION < 3
25734  "%.200s() got an unexpected keyword argument '%.200s'",
25735  function_name, PyString_AsString(key));
25736  #else
25737  "%s() got an unexpected keyword argument '%U'",
25738  function_name, key);
25739  #endif
25740  return 0;
25741 }
25742 
25743 /* WriteUnraisableException */
25744 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
25745  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
25746  int full_traceback, CYTHON_UNUSED int nogil) {
25747  PyObject *old_exc, *old_val, *old_tb;
25748  PyObject *ctx;
25749  __Pyx_PyThreadState_declare
25750 #ifdef WITH_THREAD
25751  PyGILState_STATE state;
25752  if (nogil)
25753  state = PyGILState_Ensure();
25754 #ifdef _MSC_VER
25755  else state = (PyGILState_STATE)-1;
25756 #endif
25757 #endif
25758  __Pyx_PyThreadState_assign
25759  __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
25760  if (full_traceback) {
25761  Py_XINCREF(old_exc);
25762  Py_XINCREF(old_val);
25763  Py_XINCREF(old_tb);
25764  __Pyx_ErrRestore(old_exc, old_val, old_tb);
25765  PyErr_PrintEx(1);
25766  }
25767  #if PY_MAJOR_VERSION < 3
25768  ctx = PyString_FromString(name);
25769  #else
25770  ctx = PyUnicode_FromString(name);
25771  #endif
25772  __Pyx_ErrRestore(old_exc, old_val, old_tb);
25773  if (!ctx) {
25774  PyErr_WriteUnraisable(Py_None);
25775  } else {
25776  PyErr_WriteUnraisable(ctx);
25777  Py_DECREF(ctx);
25778  }
25779 #ifdef WITH_THREAD
25780  if (nogil)
25781  PyGILState_Release(state);
25782 #endif
25783 }
25784 
25785 /* None */
25786 static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
25787  PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
25788 }
25789 
25790 /* FetchCommonType */
25791 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
25792  PyObject* fake_module;
25793  PyTypeObject* cached_type = NULL;
25794  fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
25795  if (!fake_module) return NULL;
25796  Py_INCREF(fake_module);
25797  cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
25798  if (cached_type) {
25799  if (!PyType_Check((PyObject*)cached_type)) {
25800  PyErr_Format(PyExc_TypeError,
25801  "Shared Cython type %.200s is not a type object",
25802  type->tp_name);
25803  goto bad;
25804  }
25805  if (cached_type->tp_basicsize != type->tp_basicsize) {
25806  PyErr_Format(PyExc_TypeError,
25807  "Shared Cython type %.200s has the wrong size, try recompiling",
25808  type->tp_name);
25809  goto bad;
25810  }
25811  } else {
25812  if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
25813  PyErr_Clear();
25814  if (PyType_Ready(type) < 0) goto bad;
25815  if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
25816  goto bad;
25817  Py_INCREF(type);
25818  cached_type = type;
25819  }
25820 done:
25821  Py_DECREF(fake_module);
25822  return cached_type;
25823 bad:
25824  Py_XDECREF(cached_type);
25825  cached_type = NULL;
25826  goto done;
25827 }
25828 
25829 /* CythonFunction */
25830 #include <structmember.h>
25831 static PyObject *
25832 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
25833 {
25834  if (unlikely(op->func_doc == NULL)) {
25835  if (op->func.m_ml->ml_doc) {
25836 #if PY_MAJOR_VERSION >= 3
25837  op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
25838 #else
25839  op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
25840 #endif
25841  if (unlikely(op->func_doc == NULL))
25842  return NULL;
25843  } else {
25844  Py_INCREF(Py_None);
25845  return Py_None;
25846  }
25847  }
25848  Py_INCREF(op->func_doc);
25849  return op->func_doc;
25850 }
25851 static int
25852 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25853 {
25854  PyObject *tmp = op->func_doc;
25855  if (value == NULL) {
25856  value = Py_None;
25857  }
25858  Py_INCREF(value);
25859  op->func_doc = value;
25860  Py_XDECREF(tmp);
25861  return 0;
25862 }
25863 static PyObject *
25864 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25865 {
25866  if (unlikely(op->func_name == NULL)) {
25867 #if PY_MAJOR_VERSION >= 3
25868  op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
25869 #else
25870  op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
25871 #endif
25872  if (unlikely(op->func_name == NULL))
25873  return NULL;
25874  }
25875  Py_INCREF(op->func_name);
25876  return op->func_name;
25877 }
25878 static int
25879 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25880 {
25881  PyObject *tmp;
25882 #if PY_MAJOR_VERSION >= 3
25883  if (unlikely(value == NULL || !PyUnicode_Check(value)))
25884 #else
25885  if (unlikely(value == NULL || !PyString_Check(value)))
25886 #endif
25887  {
25888  PyErr_SetString(PyExc_TypeError,
25889  "__name__ must be set to a string object");
25890  return -1;
25891  }
25892  tmp = op->func_name;
25893  Py_INCREF(value);
25894  op->func_name = value;
25895  Py_XDECREF(tmp);
25896  return 0;
25897 }
25898 static PyObject *
25899 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25900 {
25901  Py_INCREF(op->func_qualname);
25902  return op->func_qualname;
25903 }
25904 static int
25905 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25906 {
25907  PyObject *tmp;
25908 #if PY_MAJOR_VERSION >= 3
25909  if (unlikely(value == NULL || !PyUnicode_Check(value)))
25910 #else
25911  if (unlikely(value == NULL || !PyString_Check(value)))
25912 #endif
25913  {
25914  PyErr_SetString(PyExc_TypeError,
25915  "__qualname__ must be set to a string object");
25916  return -1;
25917  }
25918  tmp = op->func_qualname;
25919  Py_INCREF(value);
25920  op->func_qualname = value;
25921  Py_XDECREF(tmp);
25922  return 0;
25923 }
25924 static PyObject *
25925 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
25926 {
25927  PyObject *self;
25928  self = m->func_closure;
25929  if (self == NULL)
25930  self = Py_None;
25931  Py_INCREF(self);
25932  return self;
25933 }
25934 static PyObject *
25935 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25936 {
25937  if (unlikely(op->func_dict == NULL)) {
25938  op->func_dict = PyDict_New();
25939  if (unlikely(op->func_dict == NULL))
25940  return NULL;
25941  }
25942  Py_INCREF(op->func_dict);
25943  return op->func_dict;
25944 }
25945 static int
25946 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25947 {
25948  PyObject *tmp;
25949  if (unlikely(value == NULL)) {
25950  PyErr_SetString(PyExc_TypeError,
25951  "function's dictionary may not be deleted");
25952  return -1;
25953  }
25954  if (unlikely(!PyDict_Check(value))) {
25955  PyErr_SetString(PyExc_TypeError,
25956  "setting function's dictionary to a non-dict");
25957  return -1;
25958  }
25959  tmp = op->func_dict;
25960  Py_INCREF(value);
25961  op->func_dict = value;
25962  Py_XDECREF(tmp);
25963  return 0;
25964 }
25965 static PyObject *
25966 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25967 {
25968  Py_INCREF(op->func_globals);
25969  return op->func_globals;
25970 }
25971 static PyObject *
25972 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25973 {
25974  Py_INCREF(Py_None);
25975  return Py_None;
25976 }
25977 static PyObject *
25978 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25979 {
25980  PyObject* result = (op->func_code) ? op->func_code : Py_None;
25981  Py_INCREF(result);
25982  return result;
25983 }
25984 static int
25985 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
25986  int result = 0;
25987  PyObject *res = op->defaults_getter((PyObject *) op);
25988  if (unlikely(!res))
25989  return -1;
25990  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25991  op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
25992  Py_INCREF(op->defaults_tuple);
25993  op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
25994  Py_INCREF(op->defaults_kwdict);
25995  #else
25996  op->defaults_tuple = PySequence_ITEM(res, 0);
25997  if (unlikely(!op->defaults_tuple)) result = -1;
25998  else {
25999  op->defaults_kwdict = PySequence_ITEM(res, 1);
26000  if (unlikely(!op->defaults_kwdict)) result = -1;
26001  }
26002  #endif
26003  Py_DECREF(res);
26004  return result;
26005 }
26006 static int
26007 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
26008  PyObject* tmp;
26009  if (!value) {
26010  value = Py_None;
26011  } else if (value != Py_None && !PyTuple_Check(value)) {
26012  PyErr_SetString(PyExc_TypeError,
26013  "__defaults__ must be set to a tuple object");
26014  return -1;
26015  }
26016  Py_INCREF(value);
26017  tmp = op->defaults_tuple;
26018  op->defaults_tuple = value;
26019  Py_XDECREF(tmp);
26020  return 0;
26021 }
26022 static PyObject *
26023 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
26024  PyObject* result = op->defaults_tuple;
26025  if (unlikely(!result)) {
26026  if (op->defaults_getter) {
26027  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
26028  result = op->defaults_tuple;
26029  } else {
26030  result = Py_None;
26031  }
26032  }
26033  Py_INCREF(result);
26034  return result;
26035 }
26036 static int
26037 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
26038  PyObject* tmp;
26039  if (!value) {
26040  value = Py_None;
26041  } else if (value != Py_None && !PyDict_Check(value)) {
26042  PyErr_SetString(PyExc_TypeError,
26043  "__kwdefaults__ must be set to a dict object");
26044  return -1;
26045  }
26046  Py_INCREF(value);
26047  tmp = op->defaults_kwdict;
26048  op->defaults_kwdict = value;
26049  Py_XDECREF(tmp);
26050  return 0;
26051 }
26052 static PyObject *
26053 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
26054  PyObject* result = op->defaults_kwdict;
26055  if (unlikely(!result)) {
26056  if (op->defaults_getter) {
26057  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
26058  result = op->defaults_kwdict;
26059  } else {
26060  result = Py_None;
26061  }
26062  }
26063  Py_INCREF(result);
26064  return result;
26065 }
26066 static int
26067 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
26068  PyObject* tmp;
26069  if (!value || value == Py_None) {
26070  value = NULL;
26071  } else if (!PyDict_Check(value)) {
26072  PyErr_SetString(PyExc_TypeError,
26073  "__annotations__ must be set to a dict object");
26074  return -1;
26075  }
26076  Py_XINCREF(value);
26077  tmp = op->func_annotations;
26078  op->func_annotations = value;
26079  Py_XDECREF(tmp);
26080  return 0;
26081 }
26082 static PyObject *
26083 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
26084  PyObject* result = op->func_annotations;
26085  if (unlikely(!result)) {
26086  result = PyDict_New();
26087  if (unlikely(!result)) return NULL;
26088  op->func_annotations = result;
26089  }
26090  Py_INCREF(result);
26091  return result;
26092 }
26093 static PyGetSetDef __pyx_CyFunction_getsets[] = {
26094  {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
26095  {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
26096  {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
26097  {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
26098  {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
26099  {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
26100  {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
26101  {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
26102  {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
26103  {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
26104  {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
26105  {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
26106  {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
26107  {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
26108  {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
26109  {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
26110  {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
26111  {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
26112  {0, 0, 0, 0, 0}
26113 };
26114 static PyMemberDef __pyx_CyFunction_members[] = {
26115  {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
26116  {0, 0, 0, 0, 0}
26117 };
26118 static PyObject *
26119 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
26120 {
26121 #if PY_MAJOR_VERSION >= 3
26122  return PyUnicode_FromString(m->func.m_ml->ml_name);
26123 #else
26124  return PyString_FromString(m->func.m_ml->ml_name);
26125 #endif
26126 }
26127 static PyMethodDef __pyx_CyFunction_methods[] = {
26128  {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
26129  {0, 0, 0, 0}
26130 };
26131 #if PY_VERSION_HEX < 0x030500A0
26132 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
26133 #else
26134 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
26135 #endif
26136 static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
26137  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
26138  __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
26139  if (op == NULL)
26140  return NULL;
26141  op->flags = flags;
26142  __Pyx_CyFunction_weakreflist(op) = NULL;
26143  op->func.m_ml = ml;
26144  op->func.m_self = (PyObject *) op;
26145  Py_XINCREF(closure);
26146  op->func_closure = closure;
26147  Py_XINCREF(module);
26148  op->func.m_module = module;
26149  op->func_dict = NULL;
26150  op->func_name = NULL;
26151  Py_INCREF(qualname);
26152  op->func_qualname = qualname;
26153  op->func_doc = NULL;
26154  op->func_classobj = NULL;
26155  op->func_globals = globals;
26156  Py_INCREF(op->func_globals);
26157  Py_XINCREF(code);
26158  op->func_code = code;
26159  op->defaults_pyobjects = 0;
26160  op->defaults = NULL;
26161  op->defaults_tuple = NULL;
26162  op->defaults_kwdict = NULL;
26163  op->defaults_getter = NULL;
26164  op->func_annotations = NULL;
26165  PyObject_GC_Track(op);
26166  return (PyObject *) op;
26167 }
26168 static int
26169 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
26170 {
26171  Py_CLEAR(m->func_closure);
26172  Py_CLEAR(m->func.m_module);
26173  Py_CLEAR(m->func_dict);
26174  Py_CLEAR(m->func_name);
26175  Py_CLEAR(m->func_qualname);
26176  Py_CLEAR(m->func_doc);
26177  Py_CLEAR(m->func_globals);
26178  Py_CLEAR(m->func_code);
26179  Py_CLEAR(m->func_classobj);
26180  Py_CLEAR(m->defaults_tuple);
26181  Py_CLEAR(m->defaults_kwdict);
26182  Py_CLEAR(m->func_annotations);
26183  if (m->defaults) {
26184  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
26185  int i;
26186  for (i = 0; i < m->defaults_pyobjects; i++)
26187  Py_XDECREF(pydefaults[i]);
26188  PyObject_Free(m->defaults);
26189  m->defaults = NULL;
26190  }
26191  return 0;
26192 }
26193 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
26194 {
26195  if (__Pyx_CyFunction_weakreflist(m) != NULL)
26196  PyObject_ClearWeakRefs((PyObject *) m);
26197  __Pyx_CyFunction_clear(m);
26198  PyObject_GC_Del(m);
26199 }
26200 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
26201 {
26202  PyObject_GC_UnTrack(m);
26203  __Pyx__CyFunction_dealloc(m);
26204 }
26205 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
26206 {
26207  Py_VISIT(m->func_closure);
26208  Py_VISIT(m->func.m_module);
26209  Py_VISIT(m->func_dict);
26210  Py_VISIT(m->func_name);
26211  Py_VISIT(m->func_qualname);
26212  Py_VISIT(m->func_doc);
26213  Py_VISIT(m->func_globals);
26214  Py_VISIT(m->func_code);
26215  Py_VISIT(m->func_classobj);
26216  Py_VISIT(m->defaults_tuple);
26217  Py_VISIT(m->defaults_kwdict);
26218  if (m->defaults) {
26219  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
26220  int i;
26221  for (i = 0; i < m->defaults_pyobjects; i++)
26222  Py_VISIT(pydefaults[i]);
26223  }
26224  return 0;
26225 }
26226 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
26227 {
26228  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26229  if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
26230  Py_INCREF(func);
26231  return func;
26232  }
26233  if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
26234  if (type == NULL)
26235  type = (PyObject *)(Py_TYPE(obj));
26236  return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
26237  }
26238  if (obj == Py_None)
26239  obj = NULL;
26240  return __Pyx_PyMethod_New(func, obj, type);
26241 }
26242 static PyObject*
26243 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
26244 {
26245 #if PY_MAJOR_VERSION >= 3
26246  return PyUnicode_FromFormat("<cyfunction %U at %p>",
26247  op->func_qualname, (void *)op);
26248 #else
26249  return PyString_FromFormat("<cyfunction %s at %p>",
26250  PyString_AsString(op->func_qualname), (void *)op);
26251 #endif
26252 }
26253 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
26254  PyCFunctionObject* f = (PyCFunctionObject*)func;
26255  PyCFunction meth = f->m_ml->ml_meth;
26256  Py_ssize_t size;
26257  switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
26258  case METH_VARARGS:
26259  if (likely(kw == NULL || PyDict_Size(kw) == 0))
26260  return (*meth)(self, arg);
26261  break;
26262  case METH_VARARGS | METH_KEYWORDS:
26263  return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
26264  case METH_NOARGS:
26265  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26266  size = PyTuple_GET_SIZE(arg);
26267  if (likely(size == 0))
26268  return (*meth)(self, NULL);
26269  PyErr_Format(PyExc_TypeError,
26270  "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
26271  f->m_ml->ml_name, size);
26272  return NULL;
26273  }
26274  break;
26275  case METH_O:
26276  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26277  size = PyTuple_GET_SIZE(arg);
26278  if (likely(size == 1)) {
26279  PyObject *result, *arg0;
26280  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26281  arg0 = PyTuple_GET_ITEM(arg, 0);
26282  #else
26283  arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
26284  #endif
26285  result = (*meth)(self, arg0);
26286  #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
26287  Py_DECREF(arg0);
26288  #endif
26289  return result;
26290  }
26291  PyErr_Format(PyExc_TypeError,
26292  "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
26293  f->m_ml->ml_name, size);
26294  return NULL;
26295  }
26296  break;
26297  default:
26298  PyErr_SetString(PyExc_SystemError, "Bad call flags in "
26299  "__Pyx_CyFunction_Call. METH_OLDARGS is no "
26300  "longer supported!");
26301  return NULL;
26302  }
26303  PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
26304  f->m_ml->ml_name);
26305  return NULL;
26306 }
26307 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
26308  return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
26309 }
26310 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
26311  PyObject *result;
26312  __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
26313  if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
26314  Py_ssize_t argc;
26315  PyObject *new_args;
26316  PyObject *self;
26317  argc = PyTuple_GET_SIZE(args);
26318  new_args = PyTuple_GetSlice(args, 1, argc);
26319  if (unlikely(!new_args))
26320  return NULL;
26321  self = PyTuple_GetItem(args, 0);
26322  if (unlikely(!self)) {
26323  Py_DECREF(new_args);
26324  return NULL;
26325  }
26326  result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
26327  Py_DECREF(new_args);
26328  } else {
26329  result = __Pyx_CyFunction_Call(func, args, kw);
26330  }
26331  return result;
26332 }
26333 static PyTypeObject __pyx_CyFunctionType_type = {
26334  PyVarObject_HEAD_INIT(0, 0)
26335  "cython_function_or_method",
26336  sizeof(__pyx_CyFunctionObject),
26337  0,
26338  (destructor) __Pyx_CyFunction_dealloc,
26339  0,
26340  0,
26341  0,
26342 #if PY_MAJOR_VERSION < 3
26343  0,
26344 #else
26345  0,
26346 #endif
26347  (reprfunc) __Pyx_CyFunction_repr,
26348  0,
26349  0,
26350  0,
26351  0,
26352  __Pyx_CyFunction_CallAsMethod,
26353  0,
26354  0,
26355  0,
26356  0,
26357  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
26358  0,
26359  (traverseproc) __Pyx_CyFunction_traverse,
26360  (inquiry) __Pyx_CyFunction_clear,
26361  0,
26362 #if PY_VERSION_HEX < 0x030500A0
26363  offsetof(__pyx_CyFunctionObject, func_weakreflist),
26364 #else
26365  offsetof(PyCFunctionObject, m_weakreflist),
26366 #endif
26367  0,
26368  0,
26369  __pyx_CyFunction_methods,
26370  __pyx_CyFunction_members,
26371  __pyx_CyFunction_getsets,
26372  0,
26373  0,
26374  __Pyx_CyFunction_descr_get,
26375  0,
26376  offsetof(__pyx_CyFunctionObject, func_dict),
26377  0,
26378  0,
26379  0,
26380  0,
26381  0,
26382  0,
26383  0,
26384  0,
26385  0,
26386  0,
26387  0,
26388  0,
26389 #if PY_VERSION_HEX >= 0x030400a1
26390  0,
26391 #endif
26392 };
26393 static int __pyx_CyFunction_init(void) {
26394  __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
26395  if (unlikely(__pyx_CyFunctionType == NULL)) {
26396  return -1;
26397  }
26398  return 0;
26399 }
26400 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
26401  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26402  m->defaults = PyObject_Malloc(size);
26403  if (unlikely(!m->defaults))
26404  return PyErr_NoMemory();
26405  memset(m->defaults, 0, size);
26406  m->defaults_pyobjects = pyobjects;
26407  return m->defaults;
26408 }
26409 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
26410  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26411  m->defaults_tuple = tuple;
26412  Py_INCREF(tuple);
26413 }
26414 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
26415  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26416  m->defaults_kwdict = dict;
26417  Py_INCREF(dict);
26418 }
26419 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
26420  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26421  m->func_annotations = dict;
26422  Py_INCREF(dict);
26423 }
26424 
26425 /* PyObjectCall2Args */
26426 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
26427  PyObject *args, *result = NULL;
26428  #if CYTHON_FAST_PYCALL
26429  if (PyFunction_Check(function)) {
26430  PyObject *args[2] = {arg1, arg2};
26431  return __Pyx_PyFunction_FastCall(function, args, 2);
26432  }
26433  #endif
26434  #if CYTHON_FAST_PYCCALL
26435  if (__Pyx_PyFastCFunction_Check(function)) {
26436  PyObject *args[2] = {arg1, arg2};
26437  return __Pyx_PyCFunction_FastCall(function, args, 2);
26438  }
26439  #endif
26440  args = PyTuple_New(2);
26441  if (unlikely(!args)) goto done;
26442  Py_INCREF(arg1);
26443  PyTuple_SET_ITEM(args, 0, arg1);
26444  Py_INCREF(arg2);
26445  PyTuple_SET_ITEM(args, 1, arg2);
26446  Py_INCREF(function);
26447  result = __Pyx_PyObject_Call(function, args, NULL);
26448  Py_DECREF(args);
26449  Py_DECREF(function);
26450 done:
26451  return result;
26452 }
26453 
26454 /* SliceObject */
26455 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
26456  Py_ssize_t cstart, Py_ssize_t cstop,
26457  PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
26458  int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
26459 #if CYTHON_USE_TYPE_SLOTS
26460  PyMappingMethods* mp;
26461 #if PY_MAJOR_VERSION < 3
26462  PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
26463  if (likely(ms && ms->sq_slice)) {
26464  if (!has_cstart) {
26465  if (_py_start && (*_py_start != Py_None)) {
26466  cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
26467  if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
26468  } else
26469  cstart = 0;
26470  }
26471  if (!has_cstop) {
26472  if (_py_stop && (*_py_stop != Py_None)) {
26473  cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
26474  if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
26475  } else
26476  cstop = PY_SSIZE_T_MAX;
26477  }
26478  if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
26479  Py_ssize_t l = ms->sq_length(obj);
26480  if (likely(l >= 0)) {
26481  if (cstop < 0) {
26482  cstop += l;
26483  if (cstop < 0) cstop = 0;
26484  }
26485  if (cstart < 0) {
26486  cstart += l;
26487  if (cstart < 0) cstart = 0;
26488  }
26489  } else {
26490  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
26491  goto bad;
26492  PyErr_Clear();
26493  }
26494  }
26495  return ms->sq_slice(obj, cstart, cstop);
26496  }
26497 #endif
26498  mp = Py_TYPE(obj)->tp_as_mapping;
26499  if (likely(mp && mp->mp_subscript))
26500 #endif
26501  {
26502  PyObject* result;
26503  PyObject *py_slice, *py_start, *py_stop;
26504  if (_py_slice) {
26505  py_slice = *_py_slice;
26506  } else {
26507  PyObject* owned_start = NULL;
26508  PyObject* owned_stop = NULL;
26509  if (_py_start) {
26510  py_start = *_py_start;
26511  } else {
26512  if (has_cstart) {
26513  owned_start = py_start = PyInt_FromSsize_t(cstart);
26514  if (unlikely(!py_start)) goto bad;
26515  } else
26516  py_start = Py_None;
26517  }
26518  if (_py_stop) {
26519  py_stop = *_py_stop;
26520  } else {
26521  if (has_cstop) {
26522  owned_stop = py_stop = PyInt_FromSsize_t(cstop);
26523  if (unlikely(!py_stop)) {
26524  Py_XDECREF(owned_start);
26525  goto bad;
26526  }
26527  } else
26528  py_stop = Py_None;
26529  }
26530  py_slice = PySlice_New(py_start, py_stop, Py_None);
26531  Py_XDECREF(owned_start);
26532  Py_XDECREF(owned_stop);
26533  if (unlikely(!py_slice)) goto bad;
26534  }
26535 #if CYTHON_USE_TYPE_SLOTS
26536  result = mp->mp_subscript(obj, py_slice);
26537 #else
26538  result = PyObject_GetItem(obj, py_slice);
26539 #endif
26540  if (!_py_slice) {
26541  Py_DECREF(py_slice);
26542  }
26543  return result;
26544  }
26545  PyErr_Format(PyExc_TypeError,
26546  "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
26547 bad:
26548  return NULL;
26549 }
26550 
26551 /* RaiseException */
26552 #if PY_MAJOR_VERSION < 3
26553 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
26554  CYTHON_UNUSED PyObject *cause) {
26555  __Pyx_PyThreadState_declare
26556  Py_XINCREF(type);
26557  if (!value || value == Py_None)
26558  value = NULL;
26559  else
26560  Py_INCREF(value);
26561  if (!tb || tb == Py_None)
26562  tb = NULL;
26563  else {
26564  Py_INCREF(tb);
26565  if (!PyTraceBack_Check(tb)) {
26566  PyErr_SetString(PyExc_TypeError,
26567  "raise: arg 3 must be a traceback or None");
26568  goto raise_error;
26569  }
26570  }
26571  if (PyType_Check(type)) {
26572 #if CYTHON_COMPILING_IN_PYPY
26573  if (!value) {
26574  Py_INCREF(Py_None);
26575  value = Py_None;
26576  }
26577 #endif
26578  PyErr_NormalizeException(&type, &value, &tb);
26579  } else {
26580  if (value) {
26581  PyErr_SetString(PyExc_TypeError,
26582  "instance exception may not have a separate value");
26583  goto raise_error;
26584  }
26585  value = type;
26586  type = (PyObject*) Py_TYPE(type);
26587  Py_INCREF(type);
26588  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
26589  PyErr_SetString(PyExc_TypeError,
26590  "raise: exception class must be a subclass of BaseException");
26591  goto raise_error;
26592  }
26593  }
26594  __Pyx_PyThreadState_assign
26595  __Pyx_ErrRestore(type, value, tb);
26596  return;
26597 raise_error:
26598  Py_XDECREF(value);
26599  Py_XDECREF(type);
26600  Py_XDECREF(tb);
26601  return;
26602 }
26603 #else
26604 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
26605  PyObject* owned_instance = NULL;
26606  if (tb == Py_None) {
26607  tb = 0;
26608  } else if (tb && !PyTraceBack_Check(tb)) {
26609  PyErr_SetString(PyExc_TypeError,
26610  "raise: arg 3 must be a traceback or None");
26611  goto bad;
26612  }
26613  if (value == Py_None)
26614  value = 0;
26615  if (PyExceptionInstance_Check(type)) {
26616  if (value) {
26617  PyErr_SetString(PyExc_TypeError,
26618  "instance exception may not have a separate value");
26619  goto bad;
26620  }
26621  value = type;
26622  type = (PyObject*) Py_TYPE(value);
26623  } else if (PyExceptionClass_Check(type)) {
26624  PyObject *instance_class = NULL;
26625  if (value && PyExceptionInstance_Check(value)) {
26626  instance_class = (PyObject*) Py_TYPE(value);
26627  if (instance_class != type) {
26628  int is_subclass = PyObject_IsSubclass(instance_class, type);
26629  if (!is_subclass) {
26630  instance_class = NULL;
26631  } else if (unlikely(is_subclass == -1)) {
26632  goto bad;
26633  } else {
26634  type = instance_class;
26635  }
26636  }
26637  }
26638  if (!instance_class) {
26639  PyObject *args;
26640  if (!value)
26641  args = PyTuple_New(0);
26642  else if (PyTuple_Check(value)) {
26643  Py_INCREF(value);
26644  args = value;
26645  } else
26646  args = PyTuple_Pack(1, value);
26647  if (!args)
26648  goto bad;
26649  owned_instance = PyObject_Call(type, args, NULL);
26650  Py_DECREF(args);
26651  if (!owned_instance)
26652  goto bad;
26653  value = owned_instance;
26654  if (!PyExceptionInstance_Check(value)) {
26655  PyErr_Format(PyExc_TypeError,
26656  "calling %R should have returned an instance of "
26657  "BaseException, not %R",
26658  type, Py_TYPE(value));
26659  goto bad;
26660  }
26661  }
26662  } else {
26663  PyErr_SetString(PyExc_TypeError,
26664  "raise: exception class must be a subclass of BaseException");
26665  goto bad;
26666  }
26667  if (cause) {
26668  PyObject *fixed_cause;
26669  if (cause == Py_None) {
26670  fixed_cause = NULL;
26671  } else if (PyExceptionClass_Check(cause)) {
26672  fixed_cause = PyObject_CallObject(cause, NULL);
26673  if (fixed_cause == NULL)
26674  goto bad;
26675  } else if (PyExceptionInstance_Check(cause)) {
26676  fixed_cause = cause;
26677  Py_INCREF(fixed_cause);
26678  } else {
26679  PyErr_SetString(PyExc_TypeError,
26680  "exception causes must derive from "
26681  "BaseException");
26682  goto bad;
26683  }
26684  PyException_SetCause(value, fixed_cause);
26685  }
26686  PyErr_SetObject(type, value);
26687  if (tb) {
26688 #if CYTHON_COMPILING_IN_PYPY
26689  PyObject *tmp_type, *tmp_value, *tmp_tb;
26690  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
26691  Py_INCREF(tb);
26692  PyErr_Restore(tmp_type, tmp_value, tb);
26693  Py_XDECREF(tmp_tb);
26694 #else
26695  PyThreadState *tstate = __Pyx_PyThreadState_Current;
26696  PyObject* tmp_tb = tstate->curexc_traceback;
26697  if (tb != tmp_tb) {
26698  Py_INCREF(tb);
26699  tstate->curexc_traceback = tb;
26700  Py_XDECREF(tmp_tb);
26701  }
26702 #endif
26703  }
26704 bad:
26705  Py_XDECREF(owned_instance);
26706  return;
26707 }
26708 #endif
26709 
26710 /* HasAttr */
26711 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
26712  PyObject *r;
26713  if (unlikely(!__Pyx_PyBaseString_Check(n))) {
26714  PyErr_SetString(PyExc_TypeError,
26715  "hasattr(): attribute name must be string");
26716  return -1;
26717  }
26718  r = __Pyx_GetAttr(o, n);
26719  if (unlikely(!r)) {
26720  PyErr_Clear();
26721  return 0;
26722  } else {
26723  Py_DECREF(r);
26724  return 1;
26725  }
26726 }
26727 
26728 /* DictGetItem */
26729 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
26730 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
26731  PyObject *value;
26732  value = PyDict_GetItemWithError(d, key);
26733  if (unlikely(!value)) {
26734  if (!PyErr_Occurred()) {
26735  if (unlikely(PyTuple_Check(key))) {
26736  PyObject* args = PyTuple_Pack(1, key);
26737  if (likely(args)) {
26738  PyErr_SetObject(PyExc_KeyError, args);
26739  Py_DECREF(args);
26740  }
26741  } else {
26742  PyErr_SetObject(PyExc_KeyError, key);
26743  }
26744  }
26745  return NULL;
26746  }
26747  Py_INCREF(value);
26748  return value;
26749 }
26750 #endif
26751 
26752 /* RaiseTooManyValuesToUnpack */
26753 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
26754  PyErr_Format(PyExc_ValueError,
26755  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
26756 }
26757 
26758 /* RaiseNeedMoreValuesToUnpack */
26759 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
26760  PyErr_Format(PyExc_ValueError,
26761  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
26762  index, (index == 1) ? "" : "s");
26763 }
26764 
26765 /* RaiseNoneIterError */
26766 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
26767  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
26768 }
26769 
26770 /* ExtTypeTest */
26771 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
26772  if (unlikely(!type)) {
26773  PyErr_SetString(PyExc_SystemError, "Missing type object");
26774  return 0;
26775  }
26776  if (likely(__Pyx_TypeCheck(obj, type)))
26777  return 1;
26778  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
26779  Py_TYPE(obj)->tp_name, type->tp_name);
26780  return 0;
26781 }
26782 
26783 /* GetTopmostException */
26784 #if CYTHON_USE_EXC_INFO_STACK
26785 static _PyErr_StackItem *
26786 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
26787 {
26788  _PyErr_StackItem *exc_info = tstate->exc_info;
26789  while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
26790  exc_info->previous_item != NULL)
26791  {
26792  exc_info = exc_info->previous_item;
26793  }
26794  return exc_info;
26795 }
26796 #endif
26797 
26798 /* SaveResetException */
26799 #if CYTHON_FAST_THREAD_STATE
26800 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
26801  #if CYTHON_USE_EXC_INFO_STACK
26802  _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
26803  *type = exc_info->exc_type;
26804  *value = exc_info->exc_value;
26805  *tb = exc_info->exc_traceback;
26806  #else
26807  *type = tstate->exc_type;
26808  *value = tstate->exc_value;
26809  *tb = tstate->exc_traceback;
26810  #endif
26811  Py_XINCREF(*type);
26812  Py_XINCREF(*value);
26813  Py_XINCREF(*tb);
26814 }
26815 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
26816  PyObject *tmp_type, *tmp_value, *tmp_tb;
26817  #if CYTHON_USE_EXC_INFO_STACK
26818  _PyErr_StackItem *exc_info = tstate->exc_info;
26819  tmp_type = exc_info->exc_type;
26820  tmp_value = exc_info->exc_value;
26821  tmp_tb = exc_info->exc_traceback;
26822  exc_info->exc_type = type;
26823  exc_info->exc_value = value;
26824  exc_info->exc_traceback = tb;
26825  #else
26826  tmp_type = tstate->exc_type;
26827  tmp_value = tstate->exc_value;
26828  tmp_tb = tstate->exc_traceback;
26829  tstate->exc_type = type;
26830  tstate->exc_value = value;
26831  tstate->exc_traceback = tb;
26832  #endif
26833  Py_XDECREF(tmp_type);
26834  Py_XDECREF(tmp_value);
26835  Py_XDECREF(tmp_tb);
26836 }
26837 #endif
26838 
26839 /* GetException */
26840 #if CYTHON_FAST_THREAD_STATE
26841 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
26842 #else
26843 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
26844 #endif
26845 {
26846  PyObject *local_type, *local_value, *local_tb;
26847 #if CYTHON_FAST_THREAD_STATE
26848  PyObject *tmp_type, *tmp_value, *tmp_tb;
26849  local_type = tstate->curexc_type;
26850  local_value = tstate->curexc_value;
26851  local_tb = tstate->curexc_traceback;
26852  tstate->curexc_type = 0;
26853  tstate->curexc_value = 0;
26854  tstate->curexc_traceback = 0;
26855 #else
26856  PyErr_Fetch(&local_type, &local_value, &local_tb);
26857 #endif
26858  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
26859 #if CYTHON_FAST_THREAD_STATE
26860  if (unlikely(tstate->curexc_type))
26861 #else
26862  if (unlikely(PyErr_Occurred()))
26863 #endif
26864  goto bad;
26865  #if PY_MAJOR_VERSION >= 3
26866  if (local_tb) {
26867  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
26868  goto bad;
26869  }
26870  #endif
26871  Py_XINCREF(local_tb);
26872  Py_XINCREF(local_type);
26873  Py_XINCREF(local_value);
26874  *type = local_type;
26875  *value = local_value;
26876  *tb = local_tb;
26877 #if CYTHON_FAST_THREAD_STATE
26878  #if CYTHON_USE_EXC_INFO_STACK
26879  {
26880  _PyErr_StackItem *exc_info = tstate->exc_info;
26881  tmp_type = exc_info->exc_type;
26882  tmp_value = exc_info->exc_value;
26883  tmp_tb = exc_info->exc_traceback;
26884  exc_info->exc_type = local_type;
26885  exc_info->exc_value = local_value;
26886  exc_info->exc_traceback = local_tb;
26887  }
26888  #else
26889  tmp_type = tstate->exc_type;
26890  tmp_value = tstate->exc_value;
26891  tmp_tb = tstate->exc_traceback;
26892  tstate->exc_type = local_type;
26893  tstate->exc_value = local_value;
26894  tstate->exc_traceback = local_tb;
26895  #endif
26896  Py_XDECREF(tmp_type);
26897  Py_XDECREF(tmp_value);
26898  Py_XDECREF(tmp_tb);
26899 #else
26900  PyErr_SetExcInfo(local_type, local_value, local_tb);
26901 #endif
26902  return 0;
26903 bad:
26904  *type = 0;
26905  *value = 0;
26906  *tb = 0;
26907  Py_XDECREF(local_type);
26908  Py_XDECREF(local_value);
26909  Py_XDECREF(local_tb);
26910  return -1;
26911 }
26912 
26913 /* ArgTypeTest */
26914 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
26915 {
26916  if (unlikely(!type)) {
26917  PyErr_SetString(PyExc_SystemError, "Missing type object");
26918  return 0;
26919  }
26920  else if (exact) {
26921  #if PY_MAJOR_VERSION == 2
26922  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
26923  #endif
26924  }
26925  else {
26926  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
26927  }
26928  PyErr_Format(PyExc_TypeError,
26929  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
26930  name, type->tp_name, Py_TYPE(obj)->tp_name);
26931  return 0;
26932 }
26933 
26934 /* BytesEquals */
26935 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
26936 #if CYTHON_COMPILING_IN_PYPY
26937  return PyObject_RichCompareBool(s1, s2, equals);
26938 #else
26939  if (s1 == s2) {
26940  return (equals == Py_EQ);
26941  } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
26942  const char *ps1, *ps2;
26943  Py_ssize_t length = PyBytes_GET_SIZE(s1);
26944  if (length != PyBytes_GET_SIZE(s2))
26945  return (equals == Py_NE);
26946  ps1 = PyBytes_AS_STRING(s1);
26947  ps2 = PyBytes_AS_STRING(s2);
26948  if (ps1[0] != ps2[0]) {
26949  return (equals == Py_NE);
26950  } else if (length == 1) {
26951  return (equals == Py_EQ);
26952  } else {
26953  int result;
26954 #if CYTHON_USE_UNICODE_INTERNALS
26955  Py_hash_t hash1, hash2;
26956  hash1 = ((PyBytesObject*)s1)->ob_shash;
26957  hash2 = ((PyBytesObject*)s2)->ob_shash;
26958  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
26959  return (equals == Py_NE);
26960  }
26961 #endif
26962  result = memcmp(ps1, ps2, (size_t)length);
26963  return (equals == Py_EQ) ? (result == 0) : (result != 0);
26964  }
26965  } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
26966  return (equals == Py_NE);
26967  } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
26968  return (equals == Py_NE);
26969  } else {
26970  int result;
26971  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
26972  if (!py_result)
26973  return -1;
26974  result = __Pyx_PyObject_IsTrue(py_result);
26975  Py_DECREF(py_result);
26976  return result;
26977  }
26978 #endif
26979 }
26980 
26981 /* UnicodeEquals */
26982 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
26983 #if CYTHON_COMPILING_IN_PYPY
26984  return PyObject_RichCompareBool(s1, s2, equals);
26985 #else
26986 #if PY_MAJOR_VERSION < 3
26987  PyObject* owned_ref = NULL;
26988 #endif
26989  int s1_is_unicode, s2_is_unicode;
26990  if (s1 == s2) {
26991  goto return_eq;
26992  }
26993  s1_is_unicode = PyUnicode_CheckExact(s1);
26994  s2_is_unicode = PyUnicode_CheckExact(s2);
26995 #if PY_MAJOR_VERSION < 3
26996  if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
26997  owned_ref = PyUnicode_FromObject(s2);
26998  if (unlikely(!owned_ref))
26999  return -1;
27000  s2 = owned_ref;
27001  s2_is_unicode = 1;
27002  } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
27003  owned_ref = PyUnicode_FromObject(s1);
27004  if (unlikely(!owned_ref))
27005  return -1;
27006  s1 = owned_ref;
27007  s1_is_unicode = 1;
27008  } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
27009  return __Pyx_PyBytes_Equals(s1, s2, equals);
27010  }
27011 #endif
27012  if (s1_is_unicode & s2_is_unicode) {
27013  Py_ssize_t length;
27014  int kind;
27015  void *data1, *data2;
27016  if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
27017  return -1;
27018  length = __Pyx_PyUnicode_GET_LENGTH(s1);
27019  if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
27020  goto return_ne;
27021  }
27022 #if CYTHON_USE_UNICODE_INTERNALS
27023  {
27024  Py_hash_t hash1, hash2;
27025  #if CYTHON_PEP393_ENABLED
27026  hash1 = ((PyASCIIObject*)s1)->hash;
27027  hash2 = ((PyASCIIObject*)s2)->hash;
27028  #else
27029  hash1 = ((PyUnicodeObject*)s1)->hash;
27030  hash2 = ((PyUnicodeObject*)s2)->hash;
27031  #endif
27032  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
27033  goto return_ne;
27034  }
27035  }
27036 #endif
27037  kind = __Pyx_PyUnicode_KIND(s1);
27038  if (kind != __Pyx_PyUnicode_KIND(s2)) {
27039  goto return_ne;
27040  }
27041  data1 = __Pyx_PyUnicode_DATA(s1);
27042  data2 = __Pyx_PyUnicode_DATA(s2);
27043  if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
27044  goto return_ne;
27045  } else if (length == 1) {
27046  goto return_eq;
27047  } else {
27048  int result = memcmp(data1, data2, (size_t)(length * kind));
27049  #if PY_MAJOR_VERSION < 3
27050  Py_XDECREF(owned_ref);
27051  #endif
27052  return (equals == Py_EQ) ? (result == 0) : (result != 0);
27053  }
27054  } else if ((s1 == Py_None) & s2_is_unicode) {
27055  goto return_ne;
27056  } else if ((s2 == Py_None) & s1_is_unicode) {
27057  goto return_ne;
27058  } else {
27059  int result;
27060  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
27061  #if PY_MAJOR_VERSION < 3
27062  Py_XDECREF(owned_ref);
27063  #endif
27064  if (!py_result)
27065  return -1;
27066  result = __Pyx_PyObject_IsTrue(py_result);
27067  Py_DECREF(py_result);
27068  return result;
27069  }
27070 return_eq:
27071  #if PY_MAJOR_VERSION < 3
27072  Py_XDECREF(owned_ref);
27073  #endif
27074  return (equals == Py_EQ);
27075 return_ne:
27076  #if PY_MAJOR_VERSION < 3
27077  Py_XDECREF(owned_ref);
27078  #endif
27079  return (equals == Py_NE);
27080 #endif
27081 }
27082 
27083 /* None */
27084 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
27085  Py_ssize_t q = a / b;
27086  Py_ssize_t r = a - q*b;
27087  q -= ((r != 0) & ((r ^ b) < 0));
27088  return q;
27089 }
27090 
27091 /* decode_c_string */
27092 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
27093  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
27094  const char* encoding, const char* errors,
27095  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
27096  Py_ssize_t length;
27097  if (unlikely((start < 0) | (stop < 0))) {
27098  size_t slen = strlen(cstring);
27099  if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
27100  PyErr_SetString(PyExc_OverflowError,
27101  "c-string too long to convert to Python");
27102  return NULL;
27103  }
27104  length = (Py_ssize_t) slen;
27105  if (start < 0) {
27106  start += length;
27107  if (start < 0)
27108  start = 0;
27109  }
27110  if (stop < 0)
27111  stop += length;
27112  }
27113  length = stop - start;
27114  if (unlikely(length <= 0))
27115  return PyUnicode_FromUnicode(NULL, 0);
27116  cstring += start;
27117  if (decode_func) {
27118  return decode_func(cstring, length, errors);
27119  } else {
27120  return PyUnicode_Decode(cstring, length, encoding, errors);
27121  }
27122 }
27123 
27124 /* SwapException */
27125 #if CYTHON_FAST_THREAD_STATE
27126 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
27127  PyObject *tmp_type, *tmp_value, *tmp_tb;
27128  #if CYTHON_USE_EXC_INFO_STACK
27129  _PyErr_StackItem *exc_info = tstate->exc_info;
27130  tmp_type = exc_info->exc_type;
27131  tmp_value = exc_info->exc_value;
27132  tmp_tb = exc_info->exc_traceback;
27133  exc_info->exc_type = *type;
27134  exc_info->exc_value = *value;
27135  exc_info->exc_traceback = *tb;
27136  #else
27137  tmp_type = tstate->exc_type;
27138  tmp_value = tstate->exc_value;
27139  tmp_tb = tstate->exc_traceback;
27140  tstate->exc_type = *type;
27141  tstate->exc_value = *value;
27142  tstate->exc_traceback = *tb;
27143  #endif
27144  *type = tmp_type;
27145  *value = tmp_value;
27146  *tb = tmp_tb;
27147 }
27148 #else
27149 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
27150  PyObject *tmp_type, *tmp_value, *tmp_tb;
27151  PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
27152  PyErr_SetExcInfo(*type, *value, *tb);
27153  *type = tmp_type;
27154  *value = tmp_value;
27155  *tb = tmp_tb;
27156 }
27157 #endif
27158 
27159 /* FastTypeChecks */
27160 #if CYTHON_COMPILING_IN_CPYTHON
27161 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
27162  while (a) {
27163  a = a->tp_base;
27164  if (a == b)
27165  return 1;
27166  }
27167  return b == &PyBaseObject_Type;
27168 }
27169 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
27170  PyObject *mro;
27171  if (a == b) return 1;
27172  mro = a->tp_mro;
27173  if (likely(mro)) {
27174  Py_ssize_t i, n;
27175  n = PyTuple_GET_SIZE(mro);
27176  for (i = 0; i < n; i++) {
27177  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
27178  return 1;
27179  }
27180  return 0;
27181  }
27182  return __Pyx_InBases(a, b);
27183 }
27184 #if PY_MAJOR_VERSION == 2
27185 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
27186  PyObject *exception, *value, *tb;
27187  int res;
27188  __Pyx_PyThreadState_declare
27189  __Pyx_PyThreadState_assign
27190  __Pyx_ErrFetch(&exception, &value, &tb);
27191  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
27192  if (unlikely(res == -1)) {
27193  PyErr_WriteUnraisable(err);
27194  res = 0;
27195  }
27196  if (!res) {
27197  res = PyObject_IsSubclass(err, exc_type2);
27198  if (unlikely(res == -1)) {
27199  PyErr_WriteUnraisable(err);
27200  res = 0;
27201  }
27202  }
27203  __Pyx_ErrRestore(exception, value, tb);
27204  return res;
27205 }
27206 #else
27207 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
27208  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
27209  if (!res) {
27210  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
27211  }
27212  return res;
27213 }
27214 #endif
27215 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
27216  Py_ssize_t i, n;
27217  assert(PyExceptionClass_Check(exc_type));
27218  n = PyTuple_GET_SIZE(tuple);
27219 #if PY_MAJOR_VERSION >= 3
27220  for (i=0; i<n; i++) {
27221  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
27222  }
27223 #endif
27224  for (i=0; i<n; i++) {
27225  PyObject *t = PyTuple_GET_ITEM(tuple, i);
27226  #if PY_MAJOR_VERSION < 3
27227  if (likely(exc_type == t)) return 1;
27228  #endif
27229  if (likely(PyExceptionClass_Check(t))) {
27230  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
27231  } else {
27232  }
27233  }
27234  return 0;
27235 }
27236 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
27237  if (likely(err == exc_type)) return 1;
27238  if (likely(PyExceptionClass_Check(err))) {
27239  if (likely(PyExceptionClass_Check(exc_type))) {
27240  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
27241  } else if (likely(PyTuple_Check(exc_type))) {
27242  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
27243  } else {
27244  }
27245  }
27246  return PyErr_GivenExceptionMatches(err, exc_type);
27247 }
27248 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
27249  assert(PyExceptionClass_Check(exc_type1));
27250  assert(PyExceptionClass_Check(exc_type2));
27251  if (likely(err == exc_type1 || err == exc_type2)) return 1;
27252  if (likely(PyExceptionClass_Check(err))) {
27253  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
27254  }
27255  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
27256 }
27257 #endif
27258 
27259 /* PyIntBinop */
27260 #if !CYTHON_COMPILING_IN_PYPY
27261 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
27262  #if PY_MAJOR_VERSION < 3
27263  if (likely(PyInt_CheckExact(op1))) {
27264  const long b = intval;
27265  long x;
27266  long a = PyInt_AS_LONG(op1);
27267  x = (long)((unsigned long)a + b);
27268  if (likely((x^a) >= 0 || (x^b) >= 0))
27269  return PyInt_FromLong(x);
27270  return PyLong_Type.tp_as_number->nb_add(op1, op2);
27271  }
27272  #endif
27273  #if CYTHON_USE_PYLONG_INTERNALS
27274  if (likely(PyLong_CheckExact(op1))) {
27275  const long b = intval;
27276  long a, x;
27277 #ifdef HAVE_LONG_LONG
27278  const PY_LONG_LONG llb = intval;
27279  PY_LONG_LONG lla, llx;
27280 #endif
27281  const digit* digits = ((PyLongObject*)op1)->ob_digit;
27282  const Py_ssize_t size = Py_SIZE(op1);
27283  if (likely(__Pyx_sst_abs(size) <= 1)) {
27284  a = likely(size) ? digits[0] : 0;
27285  if (size == -1) a = -a;
27286  } else {
27287  switch (size) {
27288  case -2:
27289  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
27290  a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
27291  break;
27292 #ifdef HAVE_LONG_LONG
27293  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
27294  lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
27295  goto long_long;
27296 #endif
27297  }
27298  CYTHON_FALLTHROUGH;
27299  case 2:
27300  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
27301  a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
27302  break;
27303 #ifdef HAVE_LONG_LONG
27304  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
27305  lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
27306  goto long_long;
27307 #endif
27308  }
27309  CYTHON_FALLTHROUGH;
27310  case -3:
27311  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
27312  a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
27313  break;
27314 #ifdef HAVE_LONG_LONG
27315  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
27316  lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
27317  goto long_long;
27318 #endif
27319  }
27320  CYTHON_FALLTHROUGH;
27321  case 3:
27322  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
27323  a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
27324  break;
27325 #ifdef HAVE_LONG_LONG
27326  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
27327  lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
27328  goto long_long;
27329 #endif
27330  }
27331  CYTHON_FALLTHROUGH;
27332  case -4:
27333  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
27334  a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
27335  break;
27336 #ifdef HAVE_LONG_LONG
27337  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
27338  lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
27339  goto long_long;
27340 #endif
27341  }
27342  CYTHON_FALLTHROUGH;
27343  case 4:
27344  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
27345  a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
27346  break;
27347 #ifdef HAVE_LONG_LONG
27348  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
27349  lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
27350  goto long_long;
27351 #endif
27352  }
27353  CYTHON_FALLTHROUGH;
27354  default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
27355  }
27356  }
27357  x = a + b;
27358  return PyLong_FromLong(x);
27359 #ifdef HAVE_LONG_LONG
27360  long_long:
27361  llx = lla + llb;
27362  return PyLong_FromLongLong(llx);
27363 #endif
27364 
27365 
27366  }
27367  #endif
27368  if (PyFloat_CheckExact(op1)) {
27369  const long b = intval;
27370  double a = PyFloat_AS_DOUBLE(op1);
27371  double result;
27372  PyFPE_START_PROTECT("add", return NULL)
27373  result = ((double)a) + (double)b;
27374  PyFPE_END_PROTECT(result)
27375  return PyFloat_FromDouble(result);
27376  }
27377  return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
27378 }
27379 #endif
27380 
27381 /* None */
27382 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
27383  PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
27384 }
27385 
27386 /* None */
27387 static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
27388  long q = a / b;
27389  long r = a - q*b;
27390  q -= ((r != 0) & ((r ^ b) < 0));
27391  return q;
27392 }
27393 
27394 /* PyObject_GenericGetAttrNoDict */
27395 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
27396 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
27397  PyErr_Format(PyExc_AttributeError,
27398 #if PY_MAJOR_VERSION >= 3
27399  "'%.50s' object has no attribute '%U'",
27400  tp->tp_name, attr_name);
27401 #else
27402  "'%.50s' object has no attribute '%.400s'",
27403  tp->tp_name, PyString_AS_STRING(attr_name));
27404 #endif
27405  return NULL;
27406 }
27407 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
27408  PyObject *descr;
27409  PyTypeObject *tp = Py_TYPE(obj);
27410  if (unlikely(!PyString_Check(attr_name))) {
27411  return PyObject_GenericGetAttr(obj, attr_name);
27412  }
27413  assert(!tp->tp_dictoffset);
27414  descr = _PyType_Lookup(tp, attr_name);
27415  if (unlikely(!descr)) {
27416  return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
27417  }
27418  Py_INCREF(descr);
27419  #if PY_MAJOR_VERSION < 3
27420  if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
27421  #endif
27422  {
27423  descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
27424  if (unlikely(f)) {
27425  PyObject *res = f(descr, obj, (PyObject *)tp);
27426  Py_DECREF(descr);
27427  return res;
27428  }
27429  }
27430  return descr;
27431 }
27432 #endif
27433 
27434 /* PyObject_GenericGetAttr */
27435 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
27436 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
27437  if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
27438  return PyObject_GenericGetAttr(obj, attr_name);
27439  }
27440  return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
27441 }
27442 #endif
27443 
27444 /* SetupReduce */
27445 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
27446  int ret;
27447  PyObject *name_attr;
27448  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
27449  if (likely(name_attr)) {
27450  ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
27451  } else {
27452  ret = -1;
27453  }
27454  if (unlikely(ret < 0)) {
27455  PyErr_Clear();
27456  ret = 0;
27457  }
27458  Py_XDECREF(name_attr);
27459  return ret;
27460 }
27461 static int __Pyx_setup_reduce(PyObject* type_obj) {
27462  int ret = 0;
27463  PyObject *object_reduce = NULL;
27464  PyObject *object_reduce_ex = NULL;
27465  PyObject *reduce = NULL;
27466  PyObject *reduce_ex = NULL;
27467  PyObject *reduce_cython = NULL;
27468  PyObject *setstate = NULL;
27469  PyObject *setstate_cython = NULL;
27470 #if CYTHON_USE_PYTYPE_LOOKUP
27471  if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD;
27472 #else
27473  if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
27474 #endif
27475 #if CYTHON_USE_PYTYPE_LOOKUP
27476  object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
27477 #else
27478  object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
27479 #endif
27480  reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD;
27481  if (reduce_ex == object_reduce_ex) {
27482 #if CYTHON_USE_PYTYPE_LOOKUP
27483  object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
27484 #else
27485  object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
27486 #endif
27487  reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD;
27488  if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
27489  reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
27490  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
27491  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD;
27492  setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
27493  if (!setstate) PyErr_Clear();
27494  if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
27495  setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
27496  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
27497  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
27498  }
27499  PyType_Modified((PyTypeObject*)type_obj);
27500  }
27501  }
27502  goto GOOD;
27503 BAD:
27504  if (!PyErr_Occurred())
27505  PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
27506  ret = -1;
27507 GOOD:
27508 #if !CYTHON_USE_PYTYPE_LOOKUP
27509  Py_XDECREF(object_reduce);
27510  Py_XDECREF(object_reduce_ex);
27511 #endif
27512  Py_XDECREF(reduce);
27513  Py_XDECREF(reduce_ex);
27514  Py_XDECREF(reduce_cython);
27515  Py_XDECREF(setstate);
27516  Py_XDECREF(setstate_cython);
27517  return ret;
27518 }
27519 
27520 /* SetVTable */
27521 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
27522 #if PY_VERSION_HEX >= 0x02070000
27523  PyObject *ob = PyCapsule_New(vtable, 0, 0);
27524 #else
27525  PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
27526 #endif
27527  if (!ob)
27528  goto bad;
27529  if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
27530  goto bad;
27531  Py_DECREF(ob);
27532  return 0;
27533 bad:
27534  Py_XDECREF(ob);
27535  return -1;
27536 }
27537 
27538 /* TypeImport */
27539 #ifndef __PYX_HAVE_RT_ImportType
27540 #define __PYX_HAVE_RT_ImportType
27541 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
27542  size_t size, enum __Pyx_ImportType_CheckSize check_size)
27543 {
27544  PyObject *result = 0;
27545  char warning[200];
27546  Py_ssize_t basicsize;
27547 #ifdef Py_LIMITED_API
27548  PyObject *py_basicsize;
27549 #endif
27550  result = PyObject_GetAttrString(module, class_name);
27551  if (!result)
27552  goto bad;
27553  if (!PyType_Check(result)) {
27554  PyErr_Format(PyExc_TypeError,
27555  "%.200s.%.200s is not a type object",
27556  module_name, class_name);
27557  goto bad;
27558  }
27559 #ifndef Py_LIMITED_API
27560  basicsize = ((PyTypeObject *)result)->tp_basicsize;
27561 #else
27562  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
27563  if (!py_basicsize)
27564  goto bad;
27565  basicsize = PyLong_AsSsize_t(py_basicsize);
27566  Py_DECREF(py_basicsize);
27567  py_basicsize = 0;
27568  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
27569  goto bad;
27570 #endif
27571  if ((size_t)basicsize < size) {
27572  PyErr_Format(PyExc_ValueError,
27573  "%.200s.%.200s size changed, may indicate binary incompatibility. "
27574  "Expected %zd from C header, got %zd from PyObject",
27575  module_name, class_name, size, basicsize);
27576  goto bad;
27577  }
27578  if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
27579  PyErr_Format(PyExc_ValueError,
27580  "%.200s.%.200s size changed, may indicate binary incompatibility. "
27581  "Expected %zd from C header, got %zd from PyObject",
27582  module_name, class_name, size, basicsize);
27583  goto bad;
27584  }
27585  else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
27586  PyOS_snprintf(warning, sizeof(warning),
27587  "%s.%s size changed, may indicate binary incompatibility. "
27588  "Expected %zd from C header, got %zd from PyObject",
27589  module_name, class_name, size, basicsize);
27590  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
27591  }
27592  return (PyTypeObject *)result;
27593 bad:
27594  Py_XDECREF(result);
27595  return NULL;
27596 }
27597 #endif
27598 
27599 /* CLineInTraceback */
27600 #ifndef CYTHON_CLINE_IN_TRACEBACK
27601 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
27602  PyObject *use_cline;
27603  PyObject *ptype, *pvalue, *ptraceback;
27604 #if CYTHON_COMPILING_IN_CPYTHON
27605  PyObject **cython_runtime_dict;
27606 #endif
27607  if (unlikely(!__pyx_cython_runtime)) {
27608  return c_line;
27609  }
27610  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
27611 #if CYTHON_COMPILING_IN_CPYTHON
27612  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
27613  if (likely(cython_runtime_dict)) {
27614  __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
27615  use_cline, *cython_runtime_dict,
27616  __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
27617  } else
27618 #endif
27619  {
27620  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
27621  if (use_cline_obj) {
27622  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
27623  Py_DECREF(use_cline_obj);
27624  } else {
27625  PyErr_Clear();
27626  use_cline = NULL;
27627  }
27628  }
27629  if (!use_cline) {
27630  c_line = 0;
27631  PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
27632  }
27633  else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
27634  c_line = 0;
27635  }
27636  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
27637  return c_line;
27638 }
27639 #endif
27640 
27641 /* CodeObjectCache */
27642 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
27643  int start = 0, mid = 0, end = count - 1;
27644  if (end >= 0 && code_line > entries[end].code_line) {
27645  return count;
27646  }
27647  while (start < end) {
27648  mid = start + (end - start) / 2;
27649  if (code_line < entries[mid].code_line) {
27650  end = mid;
27651  } else if (code_line > entries[mid].code_line) {
27652  start = mid + 1;
27653  } else {
27654  return mid;
27655  }
27656  }
27657  if (code_line <= entries[mid].code_line) {
27658  return mid;
27659  } else {
27660  return mid + 1;
27661  }
27662 }
27663 static PyCodeObject *__pyx_find_code_object(int code_line) {
27664  PyCodeObject* code_object;
27665  int pos;
27666  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
27667  return NULL;
27668  }
27669  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
27670  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
27671  return NULL;
27672  }
27673  code_object = __pyx_code_cache.entries[pos].code_object;
27674  Py_INCREF(code_object);
27675  return code_object;
27676 }
27677 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
27678  int pos, i;
27679  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
27680  if (unlikely(!code_line)) {
27681  return;
27682  }
27683  if (unlikely(!entries)) {
27684  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
27685  if (likely(entries)) {
27686  __pyx_code_cache.entries = entries;
27687  __pyx_code_cache.max_count = 64;
27688  __pyx_code_cache.count = 1;
27689  entries[0].code_line = code_line;
27690  entries[0].code_object = code_object;
27691  Py_INCREF(code_object);
27692  }
27693  return;
27694  }
27695  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
27696  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
27697  PyCodeObject* tmp = entries[pos].code_object;
27698  entries[pos].code_object = code_object;
27699  Py_DECREF(tmp);
27700  return;
27701  }
27702  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
27703  int new_max = __pyx_code_cache.max_count + 64;
27704  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
27705  __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
27706  if (unlikely(!entries)) {
27707  return;
27708  }
27709  __pyx_code_cache.entries = entries;
27710  __pyx_code_cache.max_count = new_max;
27711  }
27712  for (i=__pyx_code_cache.count; i>pos; i--) {
27713  entries[i] = entries[i-1];
27714  }
27715  entries[pos].code_line = code_line;
27716  entries[pos].code_object = code_object;
27717  __pyx_code_cache.count++;
27718  Py_INCREF(code_object);
27719 }
27720 
27721 /* AddTraceback */
27722 #include "compile.h"
27723 #include "frameobject.h"
27724 #include "traceback.h"
27725 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
27726  const char *funcname, int c_line,
27727  int py_line, const char *filename) {
27728  PyCodeObject *py_code = 0;
27729  PyObject *py_srcfile = 0;
27730  PyObject *py_funcname = 0;
27731  #if PY_MAJOR_VERSION < 3
27732  py_srcfile = PyString_FromString(filename);
27733  #else
27734  py_srcfile = PyUnicode_FromString(filename);
27735  #endif
27736  if (!py_srcfile) goto bad;
27737  if (c_line) {
27738  #if PY_MAJOR_VERSION < 3
27739  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
27740  #else
27741  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
27742  #endif
27743  }
27744  else {
27745  #if PY_MAJOR_VERSION < 3
27746  py_funcname = PyString_FromString(funcname);
27747  #else
27748  py_funcname = PyUnicode_FromString(funcname);
27749  #endif
27750  }
27751  if (!py_funcname) goto bad;
27752  py_code = __Pyx_PyCode_New(
27753  0,
27754  0,
27755  0,
27756  0,
27757  0,
27758  __pyx_empty_bytes, /*PyObject *code,*/
27759  __pyx_empty_tuple, /*PyObject *consts,*/
27760  __pyx_empty_tuple, /*PyObject *names,*/
27761  __pyx_empty_tuple, /*PyObject *varnames,*/
27762  __pyx_empty_tuple, /*PyObject *freevars,*/
27763  __pyx_empty_tuple, /*PyObject *cellvars,*/
27764  py_srcfile, /*PyObject *filename,*/
27765  py_funcname, /*PyObject *name,*/
27766  py_line,
27767  __pyx_empty_bytes /*PyObject *lnotab*/
27768  );
27769  Py_DECREF(py_srcfile);
27770  Py_DECREF(py_funcname);
27771  return py_code;
27772 bad:
27773  Py_XDECREF(py_srcfile);
27774  Py_XDECREF(py_funcname);
27775  return NULL;
27776 }
27777 static void __Pyx_AddTraceback(const char *funcname, int c_line,
27778  int py_line, const char *filename) {
27779  PyCodeObject *py_code = 0;
27780  PyFrameObject *py_frame = 0;
27781  PyThreadState *tstate = __Pyx_PyThreadState_Current;
27782  if (c_line) {
27783  c_line = __Pyx_CLineForTraceback(tstate, c_line);
27784  }
27785  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
27786  if (!py_code) {
27787  py_code = __Pyx_CreateCodeObjectForTraceback(
27788  funcname, c_line, py_line, filename);
27789  if (!py_code) goto bad;
27790  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
27791  }
27792  py_frame = PyFrame_New(
27793  tstate, /*PyThreadState *tstate,*/
27794  py_code, /*PyCodeObject *code,*/
27795  __pyx_d, /*PyObject *globals,*/
27796  0 /*PyObject *locals*/
27797  );
27798  if (!py_frame) goto bad;
27799  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
27800  PyTraceBack_Here(py_frame);
27801 bad:
27802  Py_XDECREF(py_code);
27803  Py_XDECREF(py_frame);
27804 }
27805 
27806 #if PY_MAJOR_VERSION < 3
27807 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
27808  if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
27809  if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
27810  if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
27811  if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
27812  PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
27813  return -1;
27814 }
27815 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
27816  PyObject *obj = view->obj;
27817  if (!obj) return;
27818  if (PyObject_CheckBuffer(obj)) {
27819  PyBuffer_Release(view);
27820  return;
27821  }
27822  if ((0)) {}
27823  else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
27824  view->obj = NULL;
27825  Py_DECREF(obj);
27826 }
27827 #endif
27828 
27829 
27830 /* MemviewSliceIsContig */
27831 static int
27832 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
27833 {
27834  int i, index, step, start;
27835  Py_ssize_t itemsize = mvs.memview->view.itemsize;
27836  if (order == 'F') {
27837  step = 1;
27838  start = 0;
27839  } else {
27840  step = -1;
27841  start = ndim - 1;
27842  }
27843  for (i = 0; i < ndim; i++) {
27844  index = start + step * i;
27845  if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
27846  return 0;
27847  itemsize *= mvs.shape[index];
27848  }
27849  return 1;
27850 }
27851 
27852 /* OverlappingSlices */
27853 static void
27854 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
27855  void **out_start, void **out_end,
27856  int ndim, size_t itemsize)
27857 {
27858  char *start, *end;
27859  int i;
27860  start = end = slice->data;
27861  for (i = 0; i < ndim; i++) {
27862  Py_ssize_t stride = slice->strides[i];
27863  Py_ssize_t extent = slice->shape[i];
27864  if (extent == 0) {
27865  *out_start = *out_end = start;
27866  return;
27867  } else {
27868  if (stride > 0)
27869  end += stride * (extent - 1);
27870  else
27871  start += stride * (extent - 1);
27872  }
27873  }
27874  *out_start = start;
27875  *out_end = end + itemsize;
27876 }
27877 static int
27878 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
27879  __Pyx_memviewslice *slice2,
27880  int ndim, size_t itemsize)
27881 {
27882  void *start1, *end1, *start2, *end2;
27883  __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
27884  __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
27885  return (start1 < end2) && (start2 < end1);
27886 }
27887 
27888 /* Capsule */
27889 static CYTHON_INLINE PyObject *
27890 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
27891 {
27892  PyObject *cobj;
27893 #if PY_VERSION_HEX >= 0x02070000
27894  cobj = PyCapsule_New(p, sig, NULL);
27895 #else
27896  cobj = PyCObject_FromVoidPtr(p, NULL);
27897 #endif
27898  return cobj;
27899 }
27900 
27901 /* MemviewDtypeToObject */
27902 static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp) {
27903  return (PyObject *) PyFloat_FromDouble(*(double *) itemp);
27904 }
27905 static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj) {
27906  double value = __pyx_PyFloat_AsDouble(obj);
27907  if ((value == (double)-1) && PyErr_Occurred())
27908  return 0;
27909  *(double *) itemp = value;
27910  return 1;
27911 }
27912 
27913 /* IsLittleEndian */
27914 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
27915 {
27916  union {
27917  uint32_t u32;
27918  uint8_t u8[4];
27919  } S;
27920  S.u32 = 0x01020304;
27921  return S.u8[0] == 4;
27922 }
27923 
27924 /* BufferFormatCheck */
27925 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
27926  __Pyx_BufFmt_StackElem* stack,
27927  __Pyx_TypeInfo* type) {
27928  stack[0].field = &ctx->root;
27929  stack[0].parent_offset = 0;
27930  ctx->root.type = type;
27931  ctx->root.name = "buffer dtype";
27932  ctx->root.offset = 0;
27933  ctx->head = stack;
27934  ctx->head->field = &ctx->root;
27935  ctx->fmt_offset = 0;
27936  ctx->head->parent_offset = 0;
27937  ctx->new_packmode = '@';
27938  ctx->enc_packmode = '@';
27939  ctx->new_count = 1;
27940  ctx->enc_count = 0;
27941  ctx->enc_type = 0;
27942  ctx->is_complex = 0;
27943  ctx->is_valid_array = 0;
27944  ctx->struct_alignment = 0;
27945  while (type->typegroup == 'S') {
27946  ++ctx->head;
27947  ctx->head->field = type->fields;
27948  ctx->head->parent_offset = 0;
27949  type = type->fields->type;
27950  }
27951 }
27952 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
27953  int count;
27954  const char* t = *ts;
27955  if (*t < '0' || *t > '9') {
27956  return -1;
27957  } else {
27958  count = *t++ - '0';
27959  while (*t >= '0' && *t < '9') {
27960  count *= 10;
27961  count += *t++ - '0';
27962  }
27963  }
27964  *ts = t;
27965  return count;
27966 }
27967 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
27968  int number = __Pyx_BufFmt_ParseNumber(ts);
27969  if (number == -1)
27970  PyErr_Format(PyExc_ValueError,\
27971  "Does not understand character buffer dtype format string ('%c')", **ts);
27972  return number;
27973 }
27974 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
27975  PyErr_Format(PyExc_ValueError,
27976  "Unexpected format string character: '%c'", ch);
27977 }
27978 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
27979  switch (ch) {
27980  case 'c': return "'char'";
27981  case 'b': return "'signed char'";
27982  case 'B': return "'unsigned char'";
27983  case 'h': return "'short'";
27984  case 'H': return "'unsigned short'";
27985  case 'i': return "'int'";
27986  case 'I': return "'unsigned int'";
27987  case 'l': return "'long'";
27988  case 'L': return "'unsigned long'";
27989  case 'q': return "'long long'";
27990  case 'Q': return "'unsigned long long'";
27991  case 'f': return (is_complex ? "'complex float'" : "'float'");
27992  case 'd': return (is_complex ? "'complex double'" : "'double'");
27993  case 'g': return (is_complex ? "'complex long double'" : "'long double'");
27994  case 'T': return "a struct";
27995  case 'O': return "Python object";
27996  case 'P': return "a pointer";
27997  case 's': case 'p': return "a string";
27998  case 0: return "end";
27999  default: return "unparseable format string";
28000  }
28001 }
28002 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
28003  switch (ch) {
28004  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
28005  case 'h': case 'H': return 2;
28006  case 'i': case 'I': case 'l': case 'L': return 4;
28007  case 'q': case 'Q': return 8;
28008  case 'f': return (is_complex ? 8 : 4);
28009  case 'd': return (is_complex ? 16 : 8);
28010  case 'g': {
28011  PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
28012  return 0;
28013  }
28014  case 'O': case 'P': return sizeof(void*);
28015  default:
28016  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28017  return 0;
28018  }
28019 }
28020 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
28021  switch (ch) {
28022  case 'c': case 'b': case 'B': case 's': case 'p': return 1;
28023  case 'h': case 'H': return sizeof(short);
28024  case 'i': case 'I': return sizeof(int);
28025  case 'l': case 'L': return sizeof(long);
28026  #ifdef HAVE_LONG_LONG
28027  case 'q': case 'Q': return sizeof(PY_LONG_LONG);
28028  #endif
28029  case 'f': return sizeof(float) * (is_complex ? 2 : 1);
28030  case 'd': return sizeof(double) * (is_complex ? 2 : 1);
28031  case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
28032  case 'O': case 'P': return sizeof(void*);
28033  default: {
28034  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28035  return 0;
28036  }
28037  }
28038 }
28039 typedef struct { char c; short x; } __Pyx_st_short;
28040 typedef struct { char c; int x; } __Pyx_st_int;
28041 typedef struct { char c; long x; } __Pyx_st_long;
28042 typedef struct { char c; float x; } __Pyx_st_float;
28043 typedef struct { char c; double x; } __Pyx_st_double;
28044 typedef struct { char c; long double x; } __Pyx_st_longdouble;
28045 typedef struct { char c; void *x; } __Pyx_st_void_p;
28046 #ifdef HAVE_LONG_LONG
28047 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
28048 #endif
28049 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
28050  switch (ch) {
28051  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
28052  case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
28053  case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
28054  case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
28055 #ifdef HAVE_LONG_LONG
28056  case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
28057 #endif
28058  case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
28059  case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
28060  case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
28061  case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
28062  default:
28063  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28064  return 0;
28065  }
28066 }
28067 /* These are for computing the padding at the end of the struct to align
28068  on the first member of the struct. This will probably the same as above,
28069  but we don't have any guarantees.
28070  */
28071 typedef struct { short x; char c; } __Pyx_pad_short;
28072 typedef struct { int x; char c; } __Pyx_pad_int;
28073 typedef struct { long x; char c; } __Pyx_pad_long;
28074 typedef struct { float x; char c; } __Pyx_pad_float;
28075 typedef struct { double x; char c; } __Pyx_pad_double;
28076 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
28077 typedef struct { void *x; char c; } __Pyx_pad_void_p;
28078 #ifdef HAVE_LONG_LONG
28079 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
28080 #endif
28081 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
28082  switch (ch) {
28083  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
28084  case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
28085  case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
28086  case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
28087 #ifdef HAVE_LONG_LONG
28088  case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
28089 #endif
28090  case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
28091  case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
28092  case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
28093  case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
28094  default:
28095  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28096  return 0;
28097  }
28098 }
28099 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
28100  switch (ch) {
28101  case 'c':
28102  return 'H';
28103  case 'b': case 'h': case 'i':
28104  case 'l': case 'q': case 's': case 'p':
28105  return 'I';
28106  case 'B': case 'H': case 'I': case 'L': case 'Q':
28107  return 'U';
28108  case 'f': case 'd': case 'g':
28109  return (is_complex ? 'C' : 'R');
28110  case 'O':
28111  return 'O';
28112  case 'P':
28113  return 'P';
28114  default: {
28115  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28116  return 0;
28117  }
28118  }
28119 }
28120 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
28121  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
28122  const char* expected;
28123  const char* quote;
28124  if (ctx->head == NULL) {
28125  expected = "end";
28126  quote = "";
28127  } else {
28128  expected = ctx->head->field->type->name;
28129  quote = "'";
28130  }
28131  PyErr_Format(PyExc_ValueError,
28132  "Buffer dtype mismatch, expected %s%s%s but got %s",
28133  quote, expected, quote,
28134  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
28135  } else {
28136  __Pyx_StructField* field = ctx->head->field;
28137  __Pyx_StructField* parent = (ctx->head - 1)->field;
28138  PyErr_Format(PyExc_ValueError,
28139  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
28140  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
28141  parent->type->name, field->name);
28142  }
28143 }
28144 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
28145  char group;
28146  size_t size, offset, arraysize = 1;
28147  if (ctx->enc_type == 0) return 0;
28148  if (ctx->head->field->type->arraysize[0]) {
28149  int i, ndim = 0;
28150  if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
28151  ctx->is_valid_array = ctx->head->field->type->ndim == 1;
28152  ndim = 1;
28153  if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
28154  PyErr_Format(PyExc_ValueError,
28155  "Expected a dimension of size %zu, got %zu",
28156  ctx->head->field->type->arraysize[0], ctx->enc_count);
28157  return -1;
28158  }
28159  }
28160  if (!ctx->is_valid_array) {
28161  PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
28162  ctx->head->field->type->ndim, ndim);
28163  return -1;
28164  }
28165  for (i = 0; i < ctx->head->field->type->ndim; i++) {
28166  arraysize *= ctx->head->field->type->arraysize[i];
28167  }
28168  ctx->is_valid_array = 0;
28169  ctx->enc_count = 1;
28170  }
28171  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
28172  do {
28173  __Pyx_StructField* field = ctx->head->field;
28174  __Pyx_TypeInfo* type = field->type;
28175  if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
28176  size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
28177  } else {
28178  size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
28179  }
28180  if (ctx->enc_packmode == '@') {
28181  size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
28182  size_t align_mod_offset;
28183  if (align_at == 0) return -1;
28184  align_mod_offset = ctx->fmt_offset % align_at;
28185  if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
28186  if (ctx->struct_alignment == 0)
28187  ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
28188  ctx->is_complex);
28189  }
28190  if (type->size != size || type->typegroup != group) {
28191  if (type->typegroup == 'C' && type->fields != NULL) {
28192  size_t parent_offset = ctx->head->parent_offset + field->offset;
28193  ++ctx->head;
28194  ctx->head->field = type->fields;
28195  ctx->head->parent_offset = parent_offset;
28196  continue;
28197  }
28198  if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
28199  } else {
28200  __Pyx_BufFmt_RaiseExpected(ctx);
28201  return -1;
28202  }
28203  }
28204  offset = ctx->head->parent_offset + field->offset;
28205  if (ctx->fmt_offset != offset) {
28206  PyErr_Format(PyExc_ValueError,
28207  "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
28208  (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
28209  return -1;
28210  }
28211  ctx->fmt_offset += size;
28212  if (arraysize)
28213  ctx->fmt_offset += (arraysize - 1) * size;
28214  --ctx->enc_count;
28215  while (1) {
28216  if (field == &ctx->root) {
28217  ctx->head = NULL;
28218  if (ctx->enc_count != 0) {
28219  __Pyx_BufFmt_RaiseExpected(ctx);
28220  return -1;
28221  }
28222  break;
28223  }
28224  ctx->head->field = ++field;
28225  if (field->type == NULL) {
28226  --ctx->head;
28227  field = ctx->head->field;
28228  continue;
28229  } else if (field->type->typegroup == 'S') {
28230  size_t parent_offset = ctx->head->parent_offset + field->offset;
28231  if (field->type->fields->type == NULL) continue;
28232  field = field->type->fields;
28233  ++ctx->head;
28234  ctx->head->field = field;
28235  ctx->head->parent_offset = parent_offset;
28236  break;
28237  } else {
28238  break;
28239  }
28240  }
28241  } while (ctx->enc_count);
28242  ctx->enc_type = 0;
28243  ctx->is_complex = 0;
28244  return 0;
28245 }
28246 static PyObject *
28247 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
28248 {
28249  const char *ts = *tsp;
28250  int i = 0, number;
28251  int ndim = ctx->head->field->type->ndim;
28252 ;
28253  ++ts;
28254  if (ctx->new_count != 1) {
28255  PyErr_SetString(PyExc_ValueError,
28256  "Cannot handle repeated arrays in format string");
28257  return NULL;
28258  }
28259  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
28260  while (*ts && *ts != ')') {
28261  switch (*ts) {
28262  case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
28263  default: break;
28264  }
28265  number = __Pyx_BufFmt_ExpectNumber(&ts);
28266  if (number == -1) return NULL;
28267  if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
28268  return PyErr_Format(PyExc_ValueError,
28269  "Expected a dimension of size %zu, got %d",
28270  ctx->head->field->type->arraysize[i], number);
28271  if (*ts != ',' && *ts != ')')
28272  return PyErr_Format(PyExc_ValueError,
28273  "Expected a comma in format string, got '%c'", *ts);
28274  if (*ts == ',') ts++;
28275  i++;
28276  }
28277  if (i != ndim)
28278  return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
28279  ctx->head->field->type->ndim, i);
28280  if (!*ts) {
28281  PyErr_SetString(PyExc_ValueError,
28282  "Unexpected end of format string, expected ')'");
28283  return NULL;
28284  }
28285  ctx->is_valid_array = 1;
28286  ctx->new_count = 1;
28287  *tsp = ++ts;
28288  return Py_None;
28289 }
28290 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
28291  int got_Z = 0;
28292  while (1) {
28293  switch(*ts) {
28294  case 0:
28295  if (ctx->enc_type != 0 && ctx->head == NULL) {
28296  __Pyx_BufFmt_RaiseExpected(ctx);
28297  return NULL;
28298  }
28299  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
28300  if (ctx->head != NULL) {
28301  __Pyx_BufFmt_RaiseExpected(ctx);
28302  return NULL;
28303  }
28304  return ts;
28305  case ' ':
28306  case '\r':
28307  case '\n':
28308  ++ts;
28309  break;
28310  case '<':
28311  if (!__Pyx_Is_Little_Endian()) {
28312  PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
28313  return NULL;
28314  }
28315  ctx->new_packmode = '=';
28316  ++ts;
28317  break;
28318  case '>':
28319  case '!':
28320  if (__Pyx_Is_Little_Endian()) {
28321  PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
28322  return NULL;
28323  }
28324  ctx->new_packmode = '=';
28325  ++ts;
28326  break;
28327  case '=':
28328  case '@':
28329  case '^':
28330  ctx->new_packmode = *ts++;
28331  break;
28332  case 'T':
28333  {
28334  const char* ts_after_sub;
28335  size_t i, struct_count = ctx->new_count;
28336  size_t struct_alignment = ctx->struct_alignment;
28337  ctx->new_count = 1;
28338  ++ts;
28339  if (*ts != '{') {
28340  PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
28341  return NULL;
28342  }
28343  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
28344  ctx->enc_type = 0;
28345  ctx->enc_count = 0;
28346  ctx->struct_alignment = 0;
28347  ++ts;
28348  ts_after_sub = ts;
28349  for (i = 0; i != struct_count; ++i) {
28350  ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
28351  if (!ts_after_sub) return NULL;
28352  }
28353  ts = ts_after_sub;
28354  if (struct_alignment) ctx->struct_alignment = struct_alignment;
28355  }
28356  break;
28357  case '}':
28358  {
28359  size_t alignment = ctx->struct_alignment;
28360  ++ts;
28361  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
28362  ctx->enc_type = 0;
28363  if (alignment && ctx->fmt_offset % alignment) {
28364  ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
28365  }
28366  }
28367  return ts;
28368  case 'x':
28369  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
28370  ctx->fmt_offset += ctx->new_count;
28371  ctx->new_count = 1;
28372  ctx->enc_count = 0;
28373  ctx->enc_type = 0;
28374  ctx->enc_packmode = ctx->new_packmode;
28375  ++ts;
28376  break;
28377  case 'Z':
28378  got_Z = 1;
28379  ++ts;
28380  if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
28381  __Pyx_BufFmt_RaiseUnexpectedChar('Z');
28382  return NULL;
28383  }
28384  CYTHON_FALLTHROUGH;
28385  case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
28386  case 'l': case 'L': case 'q': case 'Q':
28387  case 'f': case 'd': case 'g':
28388  case 'O': case 'p':
28389  if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
28390  ctx->enc_packmode == ctx->new_packmode) {
28391  ctx->enc_count += ctx->new_count;
28392  ctx->new_count = 1;
28393  got_Z = 0;
28394  ++ts;
28395  break;
28396  }
28397  CYTHON_FALLTHROUGH;
28398  case 's':
28399  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
28400  ctx->enc_count = ctx->new_count;
28401  ctx->enc_packmode = ctx->new_packmode;
28402  ctx->enc_type = *ts;
28403  ctx->is_complex = got_Z;
28404  ++ts;
28405  ctx->new_count = 1;
28406  got_Z = 0;
28407  break;
28408  case ':':
28409  ++ts;
28410  while(*ts != ':') ++ts;
28411  ++ts;
28412  break;
28413  case '(':
28414  if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
28415  break;
28416  default:
28417  {
28418  int number = __Pyx_BufFmt_ExpectNumber(&ts);
28419  if (number == -1) return NULL;
28420  ctx->new_count = (size_t)number;
28421  }
28422  }
28423  }
28424 }
28425 
28426 /* TypeInfoCompare */
28427  static int
28428 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
28429 {
28430  int i;
28431  if (!a || !b)
28432  return 0;
28433  if (a == b)
28434  return 1;
28435  if (a->size != b->size || a->typegroup != b->typegroup ||
28436  a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
28437  if (a->typegroup == 'H' || b->typegroup == 'H') {
28438  return a->size == b->size;
28439  } else {
28440  return 0;
28441  }
28442  }
28443  if (a->ndim) {
28444  for (i = 0; i < a->ndim; i++)
28445  if (a->arraysize[i] != b->arraysize[i])
28446  return 0;
28447  }
28448  if (a->typegroup == 'S') {
28449  if (a->flags != b->flags)
28450  return 0;
28451  if (a->fields || b->fields) {
28452  if (!(a->fields && b->fields))
28453  return 0;
28454  for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
28455  __Pyx_StructField *field_a = a->fields + i;
28456  __Pyx_StructField *field_b = b->fields + i;
28457  if (field_a->offset != field_b->offset ||
28458  !__pyx_typeinfo_cmp(field_a->type, field_b->type))
28459  return 0;
28460  }
28461  return !a->fields[i].type && !b->fields[i].type;
28462  }
28463  }
28464  return 1;
28465 }
28466 
28467 /* MemviewSliceValidateAndInit */
28468  static int
28469 __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
28470 {
28471  if (buf->shape[dim] <= 1)
28472  return 1;
28473  if (buf->strides) {
28474  if (spec & __Pyx_MEMVIEW_CONTIG) {
28475  if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
28476  if (buf->strides[dim] != sizeof(void *)) {
28477  PyErr_Format(PyExc_ValueError,
28478  "Buffer is not indirectly contiguous "
28479  "in dimension %d.", dim);
28480  goto fail;
28481  }
28482  } else if (buf->strides[dim] != buf->itemsize) {
28483  PyErr_SetString(PyExc_ValueError,
28484  "Buffer and memoryview are not contiguous "
28485  "in the same dimension.");
28486  goto fail;
28487  }
28488  }
28489  if (spec & __Pyx_MEMVIEW_FOLLOW) {
28490  Py_ssize_t stride = buf->strides[dim];
28491  if (stride < 0)
28492  stride = -stride;
28493  if (stride < buf->itemsize) {
28494  PyErr_SetString(PyExc_ValueError,
28495  "Buffer and memoryview are not contiguous "
28496  "in the same dimension.");
28497  goto fail;
28498  }
28499  }
28500  } else {
28501  if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) {
28502  PyErr_Format(PyExc_ValueError,
28503  "C-contiguous buffer is not contiguous in "
28504  "dimension %d", dim);
28505  goto fail;
28506  } else if (spec & (__Pyx_MEMVIEW_PTR)) {
28507  PyErr_Format(PyExc_ValueError,
28508  "C-contiguous buffer is not indirect in "
28509  "dimension %d", dim);
28510  goto fail;
28511  } else if (buf->suboffsets) {
28512  PyErr_SetString(PyExc_ValueError,
28513  "Buffer exposes suboffsets but no strides");
28514  goto fail;
28515  }
28516  }
28517  return 1;
28518 fail:
28519  return 0;
28520 }
28521 static int
28522 __pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
28523 {
28524  if (spec & __Pyx_MEMVIEW_DIRECT) {
28525  if (buf->suboffsets && buf->suboffsets[dim] >= 0) {
28526  PyErr_Format(PyExc_ValueError,
28527  "Buffer not compatible with direct access "
28528  "in dimension %d.", dim);
28529  goto fail;
28530  }
28531  }
28532  if (spec & __Pyx_MEMVIEW_PTR) {
28533  if (!buf->suboffsets || (buf->suboffsets && buf->suboffsets[dim] < 0)) {
28534  PyErr_Format(PyExc_ValueError,
28535  "Buffer is not indirectly accessible "
28536  "in dimension %d.", dim);
28537  goto fail;
28538  }
28539  }
28540  return 1;
28541 fail:
28542  return 0;
28543 }
28544 static int
28545 __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
28546 {
28547  int i;
28548  if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
28549  Py_ssize_t stride = 1;
28550  for (i = 0; i < ndim; i++) {
28551  if (stride * buf->itemsize != buf->strides[i] &&
28552  buf->shape[i] > 1)
28553  {
28554  PyErr_SetString(PyExc_ValueError,
28555  "Buffer not fortran contiguous.");
28556  goto fail;
28557  }
28558  stride = stride * buf->shape[i];
28559  }
28560  } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
28561  Py_ssize_t stride = 1;
28562  for (i = ndim - 1; i >- 1; i--) {
28563  if (stride * buf->itemsize != buf->strides[i] &&
28564  buf->shape[i] > 1) {
28565  PyErr_SetString(PyExc_ValueError,
28566  "Buffer not C contiguous.");
28567  goto fail;
28568  }
28569  stride = stride * buf->shape[i];
28570  }
28571  }
28572  return 1;
28573 fail:
28574  return 0;
28575 }
28576 static int __Pyx_ValidateAndInit_memviewslice(
28577  int *axes_specs,
28578  int c_or_f_flag,
28579  int buf_flags,
28580  int ndim,
28581  __Pyx_TypeInfo *dtype,
28582  __Pyx_BufFmt_StackElem stack[],
28583  __Pyx_memviewslice *memviewslice,
28584  PyObject *original_obj)
28585 {
28586  struct __pyx_memoryview_obj *memview, *new_memview;
28587  __Pyx_RefNannyDeclarations
28588  Py_buffer *buf;
28589  int i, spec = 0, retval = -1;
28590  __Pyx_BufFmt_Context ctx;
28591  int from_memoryview = __pyx_memoryview_check(original_obj);
28592  __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
28593  if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
28594  original_obj)->typeinfo)) {
28595  memview = (struct __pyx_memoryview_obj *) original_obj;
28596  new_memview = NULL;
28597  } else {
28598  memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
28599  original_obj, buf_flags, 0, dtype);
28600  new_memview = memview;
28601  if (unlikely(!memview))
28602  goto fail;
28603  }
28604  buf = &memview->view;
28605  if (buf->ndim != ndim) {
28606  PyErr_Format(PyExc_ValueError,
28607  "Buffer has wrong number of dimensions (expected %d, got %d)",
28608  ndim, buf->ndim);
28609  goto fail;
28610  }
28611  if (new_memview) {
28612  __Pyx_BufFmt_Init(&ctx, stack, dtype);
28613  if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
28614  }
28615  if ((unsigned) buf->itemsize != dtype->size) {
28616  PyErr_Format(PyExc_ValueError,
28617  "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
28618  "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
28619  buf->itemsize,
28620  (buf->itemsize > 1) ? "s" : "",
28621  dtype->name,
28622  dtype->size,
28623  (dtype->size > 1) ? "s" : "");
28624  goto fail;
28625  }
28626  for (i = 0; i < ndim; i++) {
28627  spec = axes_specs[i];
28628  if (!__pyx_check_strides(buf, i, ndim, spec))
28629  goto fail;
28630  if (!__pyx_check_suboffsets(buf, i, ndim, spec))
28631  goto fail;
28632  }
28633  if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag))
28634  goto fail;
28635  if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
28636  new_memview != NULL) == -1)) {
28637  goto fail;
28638  }
28639  retval = 0;
28640  goto no_fail;
28641 fail:
28642  Py_XDECREF(new_memview);
28643  retval = -1;
28644 no_fail:
28645  __Pyx_RefNannyFinishContext();
28646  return retval;
28647 }
28648 
28649 /* ObjectToMemviewSlice */
28650  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj, int writable_flag) {
28651  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
28652  __Pyx_BufFmt_StackElem stack[1];
28653  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
28654  int retcode;
28655  if (obj == Py_None) {
28656  result.memview = (struct __pyx_memoryview_obj *) Py_None;
28657  return result;
28658  }
28659  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
28660  PyBUF_RECORDS_RO | writable_flag, 1,
28661  &__Pyx_TypeInfo_double, stack,
28662  &result, obj);
28663  if (unlikely(retcode == -1))
28664  goto __pyx_fail;
28665  return result;
28666 __pyx_fail:
28667  result.memview = NULL;
28668  result.data = NULL;
28669  return result;
28670 }
28671 
28672 /* CIntToPy */
28673  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
28674  const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
28675  const int is_unsigned = neg_one > const_zero;
28676  if (is_unsigned) {
28677  if (sizeof(int) < sizeof(long)) {
28678  return PyInt_FromLong((long) value);
28679  } else if (sizeof(int) <= sizeof(unsigned long)) {
28680  return PyLong_FromUnsignedLong((unsigned long) value);
28681 #ifdef HAVE_LONG_LONG
28682  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
28683  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
28684 #endif
28685  }
28686  } else {
28687  if (sizeof(int) <= sizeof(long)) {
28688  return PyInt_FromLong((long) value);
28689 #ifdef HAVE_LONG_LONG
28690  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
28691  return PyLong_FromLongLong((PY_LONG_LONG) value);
28692 #endif
28693  }
28694  }
28695  {
28696  int one = 1; int little = (int)*(unsigned char *)&one;
28697  unsigned char *bytes = (unsigned char *)&value;
28698  return _PyLong_FromByteArray(bytes, sizeof(int),
28699  little, !is_unsigned);
28700  }
28701 }
28702 
28703 /* CIntFromPyVerify */
28704  #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
28705  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
28706 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
28707  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
28708 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
28709  {\
28710  func_type value = func_value;\
28711  if (sizeof(target_type) < sizeof(func_type)) {\
28712  if (unlikely(value != (func_type) (target_type) value)) {\
28713  func_type zero = 0;\
28714  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
28715  return (target_type) -1;\
28716  if (is_unsigned && unlikely(value < zero))\
28717  goto raise_neg_overflow;\
28718  else\
28719  goto raise_overflow;\
28720  }\
28721  }\
28722  return (target_type) value;\
28723  }
28724 
28725 /* CIntToPy */
28726  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
28727  const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
28728  const int is_unsigned = neg_one > const_zero;
28729  if (is_unsigned) {
28730  if (sizeof(long) < sizeof(long)) {
28731  return PyInt_FromLong((long) value);
28732  } else if (sizeof(long) <= sizeof(unsigned long)) {
28733  return PyLong_FromUnsignedLong((unsigned long) value);
28734 #ifdef HAVE_LONG_LONG
28735  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
28736  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
28737 #endif
28738  }
28739  } else {
28740  if (sizeof(long) <= sizeof(long)) {
28741  return PyInt_FromLong((long) value);
28742 #ifdef HAVE_LONG_LONG
28743  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
28744  return PyLong_FromLongLong((PY_LONG_LONG) value);
28745 #endif
28746  }
28747  }
28748  {
28749  int one = 1; int little = (int)*(unsigned char *)&one;
28750  unsigned char *bytes = (unsigned char *)&value;
28751  return _PyLong_FromByteArray(bytes, sizeof(long),
28752  little, !is_unsigned);
28753  }
28754 }
28755 
28756 /* Declarations */
28757  #if CYTHON_CCOMPLEX
28758  #ifdef __cplusplus
28759  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
28760  return ::std::complex< float >(x, y);
28761  }
28762  #else
28763  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
28764  return x + y*(__pyx_t_float_complex)_Complex_I;
28765  }
28766  #endif
28767 #else
28768  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
28769  __pyx_t_float_complex z;
28770  z.real = x;
28771  z.imag = y;
28772  return z;
28773  }
28774 #endif
28775 
28776 /* Arithmetic */
28777  #if CYTHON_CCOMPLEX
28778 #else
28779  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28780  return (a.real == b.real) && (a.imag == b.imag);
28781  }
28782  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28783  __pyx_t_float_complex z;
28784  z.real = a.real + b.real;
28785  z.imag = a.imag + b.imag;
28786  return z;
28787  }
28788  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28789  __pyx_t_float_complex z;
28790  z.real = a.real - b.real;
28791  z.imag = a.imag - b.imag;
28792  return z;
28793  }
28794  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28795  __pyx_t_float_complex z;
28796  z.real = a.real * b.real - a.imag * b.imag;
28797  z.imag = a.real * b.imag + a.imag * b.real;
28798  return z;
28799  }
28800  #if 1
28801  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28802  if (b.imag == 0) {
28803  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
28804  } else if (fabsf(b.real) >= fabsf(b.imag)) {
28805  if (b.real == 0 && b.imag == 0) {
28806  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
28807  } else {
28808  float r = b.imag / b.real;
28809  float s = 1.0 / (b.real + b.imag * r);
28810  return __pyx_t_float_complex_from_parts(
28811  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
28812  }
28813  } else {
28814  float r = b.real / b.imag;
28815  float s = 1.0 / (b.imag + b.real * r);
28816  return __pyx_t_float_complex_from_parts(
28817  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
28818  }
28819  }
28820  #else
28821  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28822  if (b.imag == 0) {
28823  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
28824  } else {
28825  float denom = b.real * b.real + b.imag * b.imag;
28826  return __pyx_t_float_complex_from_parts(
28827  (a.real * b.real + a.imag * b.imag) / denom,
28828  (a.imag * b.real - a.real * b.imag) / denom);
28829  }
28830  }
28831  #endif
28832  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
28833  __pyx_t_float_complex z;
28834  z.real = -a.real;
28835  z.imag = -a.imag;
28836  return z;
28837  }
28838  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
28839  return (a.real == 0) && (a.imag == 0);
28840  }
28841  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
28842  __pyx_t_float_complex z;
28843  z.real = a.real;
28844  z.imag = -a.imag;
28845  return z;
28846  }
28847  #if 1
28848  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
28849  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
28850  return sqrtf(z.real*z.real + z.imag*z.imag);
28851  #else
28852  return hypotf(z.real, z.imag);
28853  #endif
28854  }
28855  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28856  __pyx_t_float_complex z;
28857  float r, lnr, theta, z_r, z_theta;
28858  if (b.imag == 0 && b.real == (int)b.real) {
28859  if (b.real < 0) {
28860  float denom = a.real * a.real + a.imag * a.imag;
28861  a.real = a.real / denom;
28862  a.imag = -a.imag / denom;
28863  b.real = -b.real;
28864  }
28865  switch ((int)b.real) {
28866  case 0:
28867  z.real = 1;
28868  z.imag = 0;
28869  return z;
28870  case 1:
28871  return a;
28872  case 2:
28873  z = __Pyx_c_prod_float(a, a);
28874  return __Pyx_c_prod_float(a, a);
28875  case 3:
28876  z = __Pyx_c_prod_float(a, a);
28877  return __Pyx_c_prod_float(z, a);
28878  case 4:
28879  z = __Pyx_c_prod_float(a, a);
28880  return __Pyx_c_prod_float(z, z);
28881  }
28882  }
28883  if (a.imag == 0) {
28884  if (a.real == 0) {
28885  return a;
28886  } else if (b.imag == 0) {
28887  z.real = powf(a.real, b.real);
28888  z.imag = 0;
28889  return z;
28890  } else if (a.real > 0) {
28891  r = a.real;
28892  theta = 0;
28893  } else {
28894  r = -a.real;
28895  theta = atan2f(0, -1);
28896  }
28897  } else {
28898  r = __Pyx_c_abs_float(a);
28899  theta = atan2f(a.imag, a.real);
28900  }
28901  lnr = logf(r);
28902  z_r = expf(lnr * b.real - theta * b.imag);
28903  z_theta = theta * b.real + lnr * b.imag;
28904  z.real = z_r * cosf(z_theta);
28905  z.imag = z_r * sinf(z_theta);
28906  return z;
28907  }
28908  #endif
28909 #endif
28910 
28911 /* Declarations */
28912  #if CYTHON_CCOMPLEX
28913  #ifdef __cplusplus
28914  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
28915  return ::std::complex< double >(x, y);
28916  }
28917  #else
28918  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
28919  return x + y*(__pyx_t_double_complex)_Complex_I;
28920  }
28921  #endif
28922 #else
28923  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
28924  __pyx_t_double_complex z;
28925  z.real = x;
28926  z.imag = y;
28927  return z;
28928  }
28929 #endif
28930 
28931 /* Arithmetic */
28932  #if CYTHON_CCOMPLEX
28933 #else
28934  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28935  return (a.real == b.real) && (a.imag == b.imag);
28936  }
28937  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28938  __pyx_t_double_complex z;
28939  z.real = a.real + b.real;
28940  z.imag = a.imag + b.imag;
28941  return z;
28942  }
28943  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28944  __pyx_t_double_complex z;
28945  z.real = a.real - b.real;
28946  z.imag = a.imag - b.imag;
28947  return z;
28948  }
28949  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28950  __pyx_t_double_complex z;
28951  z.real = a.real * b.real - a.imag * b.imag;
28952  z.imag = a.real * b.imag + a.imag * b.real;
28953  return z;
28954  }
28955  #if 1
28956  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28957  if (b.imag == 0) {
28958  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
28959  } else if (fabs(b.real) >= fabs(b.imag)) {
28960  if (b.real == 0 && b.imag == 0) {
28961  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
28962  } else {
28963  double r = b.imag / b.real;
28964  double s = 1.0 / (b.real + b.imag * r);
28965  return __pyx_t_double_complex_from_parts(
28966  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
28967  }
28968  } else {
28969  double r = b.real / b.imag;
28970  double s = 1.0 / (b.imag + b.real * r);
28971  return __pyx_t_double_complex_from_parts(
28972  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
28973  }
28974  }
28975  #else
28976  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28977  if (b.imag == 0) {
28978  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
28979  } else {
28980  double denom = b.real * b.real + b.imag * b.imag;
28981  return __pyx_t_double_complex_from_parts(
28982  (a.real * b.real + a.imag * b.imag) / denom,
28983  (a.imag * b.real - a.real * b.imag) / denom);
28984  }
28985  }
28986  #endif
28987  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
28988  __pyx_t_double_complex z;
28989  z.real = -a.real;
28990  z.imag = -a.imag;
28991  return z;
28992  }
28993  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
28994  return (a.real == 0) && (a.imag == 0);
28995  }
28996  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
28997  __pyx_t_double_complex z;
28998  z.real = a.real;
28999  z.imag = -a.imag;
29000  return z;
29001  }
29002  #if 1
29003  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
29004  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
29005  return sqrt(z.real*z.real + z.imag*z.imag);
29006  #else
29007  return hypot(z.real, z.imag);
29008  #endif
29009  }
29010  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
29011  __pyx_t_double_complex z;
29012  double r, lnr, theta, z_r, z_theta;
29013  if (b.imag == 0 && b.real == (int)b.real) {
29014  if (b.real < 0) {
29015  double denom = a.real * a.real + a.imag * a.imag;
29016  a.real = a.real / denom;
29017  a.imag = -a.imag / denom;
29018  b.real = -b.real;
29019  }
29020  switch ((int)b.real) {
29021  case 0:
29022  z.real = 1;
29023  z.imag = 0;
29024  return z;
29025  case 1:
29026  return a;
29027  case 2:
29028  z = __Pyx_c_prod_double(a, a);
29029  return __Pyx_c_prod_double(a, a);
29030  case 3:
29031  z = __Pyx_c_prod_double(a, a);
29032  return __Pyx_c_prod_double(z, a);
29033  case 4:
29034  z = __Pyx_c_prod_double(a, a);
29035  return __Pyx_c_prod_double(z, z);
29036  }
29037  }
29038  if (a.imag == 0) {
29039  if (a.real == 0) {
29040  return a;
29041  } else if (b.imag == 0) {
29042  z.real = pow(a.real, b.real);
29043  z.imag = 0;
29044  return z;
29045  } else if (a.real > 0) {
29046  r = a.real;
29047  theta = 0;
29048  } else {
29049  r = -a.real;
29050  theta = atan2(0, -1);
29051  }
29052  } else {
29053  r = __Pyx_c_abs_double(a);
29054  theta = atan2(a.imag, a.real);
29055  }
29056  lnr = log(r);
29057  z_r = exp(lnr * b.real - theta * b.imag);
29058  z_theta = theta * b.real + lnr * b.imag;
29059  z.real = z_r * cos(z_theta);
29060  z.imag = z_r * sin(z_theta);
29061  return z;
29062  }
29063  #endif
29064 #endif
29065 
29066 /* CIntToPy */
29067  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
29068  const enum NPY_TYPES neg_one = (enum NPY_TYPES) ((enum NPY_TYPES) 0 - (enum NPY_TYPES) 1), const_zero = (enum NPY_TYPES) 0;
29069  const int is_unsigned = neg_one > const_zero;
29070  if (is_unsigned) {
29071  if (sizeof(enum NPY_TYPES) < sizeof(long)) {
29072  return PyInt_FromLong((long) value);
29073  } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
29074  return PyLong_FromUnsignedLong((unsigned long) value);
29075 #ifdef HAVE_LONG_LONG
29076  } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
29077  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
29078 #endif
29079  }
29080  } else {
29081  if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
29082  return PyInt_FromLong((long) value);
29083 #ifdef HAVE_LONG_LONG
29084  } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
29085  return PyLong_FromLongLong((PY_LONG_LONG) value);
29086 #endif
29087  }
29088  }
29089  {
29090  int one = 1; int little = (int)*(unsigned char *)&one;
29091  unsigned char *bytes = (unsigned char *)&value;
29092  return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
29093  little, !is_unsigned);
29094  }
29095 }
29096 
29097 /* MemviewSliceCopyTemplate */
29098  static __Pyx_memviewslice
29099 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
29100  const char *mode, int ndim,
29101  size_t sizeof_dtype, int contig_flag,
29102  int dtype_is_object)
29103 {
29104  __Pyx_RefNannyDeclarations
29105  int i;
29106  __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
29107  struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
29108  Py_buffer *buf = &from_memview->view;
29109  PyObject *shape_tuple = NULL;
29110  PyObject *temp_int = NULL;
29111  struct __pyx_array_obj *array_obj = NULL;
29112  struct __pyx_memoryview_obj *memview_obj = NULL;
29113  __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
29114  for (i = 0; i < ndim; i++) {
29115  if (from_mvs->suboffsets[i] >= 0) {
29116  PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
29117  "indirect dimensions (axis %d)", i);
29118  goto fail;
29119  }
29120  }
29121  shape_tuple = PyTuple_New(ndim);
29122  if (unlikely(!shape_tuple)) {
29123  goto fail;
29124  }
29125  __Pyx_GOTREF(shape_tuple);
29126  for(i = 0; i < ndim; i++) {
29127  temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
29128  if(unlikely(!temp_int)) {
29129  goto fail;
29130  } else {
29131  PyTuple_SET_ITEM(shape_tuple, i, temp_int);
29132  temp_int = NULL;
29133  }
29134  }
29135  array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
29136  if (unlikely(!array_obj)) {
29137  goto fail;
29138  }
29139  __Pyx_GOTREF(array_obj);
29140  memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
29141  (PyObject *) array_obj, contig_flag,
29142  dtype_is_object,
29143  from_mvs->memview->typeinfo);
29144  if (unlikely(!memview_obj))
29145  goto fail;
29146  if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
29147  goto fail;
29148  if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
29149  dtype_is_object) < 0))
29150  goto fail;
29151  goto no_fail;
29152 fail:
29153  __Pyx_XDECREF(new_mvs.memview);
29154  new_mvs.memview = NULL;
29155  new_mvs.data = NULL;
29156 no_fail:
29157  __Pyx_XDECREF(shape_tuple);
29158  __Pyx_XDECREF(temp_int);
29159  __Pyx_XDECREF(array_obj);
29160  __Pyx_RefNannyFinishContext();
29161  return new_mvs;
29162 }
29163 
29164 /* CIntFromPy */
29165  static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
29166  const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
29167  const int is_unsigned = neg_one > const_zero;
29168 #if PY_MAJOR_VERSION < 3
29169  if (likely(PyInt_Check(x))) {
29170  if (sizeof(int) < sizeof(long)) {
29171  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
29172  } else {
29173  long val = PyInt_AS_LONG(x);
29174  if (is_unsigned && unlikely(val < 0)) {
29175  goto raise_neg_overflow;
29176  }
29177  return (int) val;
29178  }
29179  } else
29180 #endif
29181  if (likely(PyLong_Check(x))) {
29182  if (is_unsigned) {
29183 #if CYTHON_USE_PYLONG_INTERNALS
29184  const digit* digits = ((PyLongObject*)x)->ob_digit;
29185  switch (Py_SIZE(x)) {
29186  case 0: return (int) 0;
29187  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
29188  case 2:
29189  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
29190  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
29191  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29192  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
29193  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
29194  }
29195  }
29196  break;
29197  case 3:
29198  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
29199  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
29200  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29201  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
29202  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
29203  }
29204  }
29205  break;
29206  case 4:
29207  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
29208  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
29209  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29210  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
29211  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
29212  }
29213  }
29214  break;
29215  }
29216 #endif
29217 #if CYTHON_COMPILING_IN_CPYTHON
29218  if (unlikely(Py_SIZE(x) < 0)) {
29219  goto raise_neg_overflow;
29220  }
29221 #else
29222  {
29223  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
29224  if (unlikely(result < 0))
29225  return (int) -1;
29226  if (unlikely(result == 1))
29227  goto raise_neg_overflow;
29228  }
29229 #endif
29230  if (sizeof(int) <= sizeof(unsigned long)) {
29231  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
29232 #ifdef HAVE_LONG_LONG
29233  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
29234  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
29235 #endif
29236  }
29237  } else {
29238 #if CYTHON_USE_PYLONG_INTERNALS
29239  const digit* digits = ((PyLongObject*)x)->ob_digit;
29240  switch (Py_SIZE(x)) {
29241  case 0: return (int) 0;
29242  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
29243  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
29244  case -2:
29245  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
29246  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
29247  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29248  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
29249  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
29250  }
29251  }
29252  break;
29253  case 2:
29254  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
29255  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
29256  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29257  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
29258  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
29259  }
29260  }
29261  break;
29262  case -3:
29263  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
29264  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
29265  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29266  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
29267  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
29268  }
29269  }
29270  break;
29271  case 3:
29272  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
29273  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
29274  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29275  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
29276  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
29277  }
29278  }
29279  break;
29280  case -4:
29281  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
29282  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
29283  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29284  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
29285  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
29286  }
29287  }
29288  break;
29289  case 4:
29290  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
29291  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
29292  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29293  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
29294  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
29295  }
29296  }
29297  break;
29298  }
29299 #endif
29300  if (sizeof(int) <= sizeof(long)) {
29301  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
29302 #ifdef HAVE_LONG_LONG
29303  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
29304  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
29305 #endif
29306  }
29307  }
29308  {
29309 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
29310  PyErr_SetString(PyExc_RuntimeError,
29311  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
29312 #else
29313  int val;
29314  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
29315  #if PY_MAJOR_VERSION < 3
29316  if (likely(v) && !PyLong_Check(v)) {
29317  PyObject *tmp = v;
29318  v = PyNumber_Long(tmp);
29319  Py_DECREF(tmp);
29320  }
29321  #endif
29322  if (likely(v)) {
29323  int one = 1; int is_little = (int)*(unsigned char *)&one;
29324  unsigned char *bytes = (unsigned char *)&val;
29325  int ret = _PyLong_AsByteArray((PyLongObject *)v,
29326  bytes, sizeof(val),
29327  is_little, !is_unsigned);
29328  Py_DECREF(v);
29329  if (likely(!ret))
29330  return val;
29331  }
29332 #endif
29333  return (int) -1;
29334  }
29335  } else {
29336  int val;
29337  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
29338  if (!tmp) return (int) -1;
29339  val = __Pyx_PyInt_As_int(tmp);
29340  Py_DECREF(tmp);
29341  return val;
29342  }
29343 raise_overflow:
29344  PyErr_SetString(PyExc_OverflowError,
29345  "value too large to convert to int");
29346  return (int) -1;
29347 raise_neg_overflow:
29348  PyErr_SetString(PyExc_OverflowError,
29349  "can't convert negative value to int");
29350  return (int) -1;
29351 }
29352 
29353 /* CIntFromPy */
29354  static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
29355  const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
29356  const int is_unsigned = neg_one > const_zero;
29357 #if PY_MAJOR_VERSION < 3
29358  if (likely(PyInt_Check(x))) {
29359  if (sizeof(long) < sizeof(long)) {
29360  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
29361  } else {
29362  long val = PyInt_AS_LONG(x);
29363  if (is_unsigned && unlikely(val < 0)) {
29364  goto raise_neg_overflow;
29365  }
29366  return (long) val;
29367  }
29368  } else
29369 #endif
29370  if (likely(PyLong_Check(x))) {
29371  if (is_unsigned) {
29372 #if CYTHON_USE_PYLONG_INTERNALS
29373  const digit* digits = ((PyLongObject*)x)->ob_digit;
29374  switch (Py_SIZE(x)) {
29375  case 0: return (long) 0;
29376  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
29377  case 2:
29378  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
29379  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
29380  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29381  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
29382  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
29383  }
29384  }
29385  break;
29386  case 3:
29387  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
29388  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
29389  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29390  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
29391  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
29392  }
29393  }
29394  break;
29395  case 4:
29396  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
29397  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
29398  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29399  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
29400  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
29401  }
29402  }
29403  break;
29404  }
29405 #endif
29406 #if CYTHON_COMPILING_IN_CPYTHON
29407  if (unlikely(Py_SIZE(x) < 0)) {
29408  goto raise_neg_overflow;
29409  }
29410 #else
29411  {
29412  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
29413  if (unlikely(result < 0))
29414  return (long) -1;
29415  if (unlikely(result == 1))
29416  goto raise_neg_overflow;
29417  }
29418 #endif
29419  if (sizeof(long) <= sizeof(unsigned long)) {
29420  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
29421 #ifdef HAVE_LONG_LONG
29422  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
29423  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
29424 #endif
29425  }
29426  } else {
29427 #if CYTHON_USE_PYLONG_INTERNALS
29428  const digit* digits = ((PyLongObject*)x)->ob_digit;
29429  switch (Py_SIZE(x)) {
29430  case 0: return (long) 0;
29431  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
29432  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
29433  case -2:
29434  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
29435  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
29436  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29437  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
29438  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
29439  }
29440  }
29441  break;
29442  case 2:
29443  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
29444  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
29445  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29446  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
29447  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
29448  }
29449  }
29450  break;
29451  case -3:
29452  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
29453  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
29454  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29455  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
29456  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
29457  }
29458  }
29459  break;
29460  case 3:
29461  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
29462  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
29463  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29464  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
29465  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
29466  }
29467  }
29468  break;
29469  case -4:
29470  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
29471  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
29472  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29473  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
29474  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
29475  }
29476  }
29477  break;
29478  case 4:
29479  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
29480  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
29481  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29482  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
29483  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
29484  }
29485  }
29486  break;
29487  }
29488 #endif
29489  if (sizeof(long) <= sizeof(long)) {
29490  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
29491 #ifdef HAVE_LONG_LONG
29492  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
29493  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
29494 #endif
29495  }
29496  }
29497  {
29498 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
29499  PyErr_SetString(PyExc_RuntimeError,
29500  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
29501 #else
29502  long val;
29503  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
29504  #if PY_MAJOR_VERSION < 3
29505  if (likely(v) && !PyLong_Check(v)) {
29506  PyObject *tmp = v;
29507  v = PyNumber_Long(tmp);
29508  Py_DECREF(tmp);
29509  }
29510  #endif
29511  if (likely(v)) {
29512  int one = 1; int is_little = (int)*(unsigned char *)&one;
29513  unsigned char *bytes = (unsigned char *)&val;
29514  int ret = _PyLong_AsByteArray((PyLongObject *)v,
29515  bytes, sizeof(val),
29516  is_little, !is_unsigned);
29517  Py_DECREF(v);
29518  if (likely(!ret))
29519  return val;
29520  }
29521 #endif
29522  return (long) -1;
29523  }
29524  } else {
29525  long val;
29526  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
29527  if (!tmp) return (long) -1;
29528  val = __Pyx_PyInt_As_long(tmp);
29529  Py_DECREF(tmp);
29530  return val;
29531  }
29532 raise_overflow:
29533  PyErr_SetString(PyExc_OverflowError,
29534  "value too large to convert to long");
29535  return (long) -1;
29536 raise_neg_overflow:
29537  PyErr_SetString(PyExc_OverflowError,
29538  "can't convert negative value to long");
29539  return (long) -1;
29540 }
29541 
29542 /* CIntFromPy */
29543  static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
29544  const char neg_one = (char) ((char) 0 - (char) 1), const_zero = (char) 0;
29545  const int is_unsigned = neg_one > const_zero;
29546 #if PY_MAJOR_VERSION < 3
29547  if (likely(PyInt_Check(x))) {
29548  if (sizeof(char) < sizeof(long)) {
29549  __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
29550  } else {
29551  long val = PyInt_AS_LONG(x);
29552  if (is_unsigned && unlikely(val < 0)) {
29553  goto raise_neg_overflow;
29554  }
29555  return (char) val;
29556  }
29557  } else
29558 #endif
29559  if (likely(PyLong_Check(x))) {
29560  if (is_unsigned) {
29561 #if CYTHON_USE_PYLONG_INTERNALS
29562  const digit* digits = ((PyLongObject*)x)->ob_digit;
29563  switch (Py_SIZE(x)) {
29564  case 0: return (char) 0;
29565  case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
29566  case 2:
29567  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
29568  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
29569  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29570  } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
29571  return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
29572  }
29573  }
29574  break;
29575  case 3:
29576  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
29577  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
29578  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29579  } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
29580  return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
29581  }
29582  }
29583  break;
29584  case 4:
29585  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
29586  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
29587  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29588  } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
29589  return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
29590  }
29591  }
29592  break;
29593  }
29594 #endif
29595 #if CYTHON_COMPILING_IN_CPYTHON
29596  if (unlikely(Py_SIZE(x) < 0)) {
29597  goto raise_neg_overflow;
29598  }
29599 #else
29600  {
29601  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
29602  if (unlikely(result < 0))
29603  return (char) -1;
29604  if (unlikely(result == 1))
29605  goto raise_neg_overflow;
29606  }
29607 #endif
29608  if (sizeof(char) <= sizeof(unsigned long)) {
29609  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
29610 #ifdef HAVE_LONG_LONG
29611  } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
29612  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
29613 #endif
29614  }
29615  } else {
29616 #if CYTHON_USE_PYLONG_INTERNALS
29617  const digit* digits = ((PyLongObject*)x)->ob_digit;
29618  switch (Py_SIZE(x)) {
29619  case 0: return (char) 0;
29620  case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
29621  case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
29622  case -2:
29623  if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
29624  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
29625  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29626  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
29627  return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
29628  }
29629  }
29630  break;
29631  case 2:
29632  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
29633  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
29634  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29635  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
29636  return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
29637  }
29638  }
29639  break;
29640  case -3:
29641  if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
29642  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
29643  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29644  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
29645  return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
29646  }
29647  }
29648  break;
29649  case 3:
29650  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
29651  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
29652  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29653  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
29654  return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
29655  }
29656  }
29657  break;
29658  case -4:
29659  if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
29660  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
29661  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29662  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
29663  return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
29664  }
29665  }
29666  break;
29667  case 4:
29668  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
29669  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
29670  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29671  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
29672  return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
29673  }
29674  }
29675  break;
29676  }
29677 #endif
29678  if (sizeof(char) <= sizeof(long)) {
29679  __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
29680 #ifdef HAVE_LONG_LONG
29681  } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
29682  __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
29683 #endif
29684  }
29685  }
29686  {
29687 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
29688  PyErr_SetString(PyExc_RuntimeError,
29689  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
29690 #else
29691  char val;
29692  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
29693  #if PY_MAJOR_VERSION < 3
29694  if (likely(v) && !PyLong_Check(v)) {
29695  PyObject *tmp = v;
29696  v = PyNumber_Long(tmp);
29697  Py_DECREF(tmp);
29698  }
29699  #endif
29700  if (likely(v)) {
29701  int one = 1; int is_little = (int)*(unsigned char *)&one;
29702  unsigned char *bytes = (unsigned char *)&val;
29703  int ret = _PyLong_AsByteArray((PyLongObject *)v,
29704  bytes, sizeof(val),
29705  is_little, !is_unsigned);
29706  Py_DECREF(v);
29707  if (likely(!ret))
29708  return val;
29709  }
29710 #endif
29711  return (char) -1;
29712  }
29713  } else {
29714  char val;
29715  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
29716  if (!tmp) return (char) -1;
29717  val = __Pyx_PyInt_As_char(tmp);
29718  Py_DECREF(tmp);
29719  return val;
29720  }
29721 raise_overflow:
29722  PyErr_SetString(PyExc_OverflowError,
29723  "value too large to convert to char");
29724  return (char) -1;
29725 raise_neg_overflow:
29726  PyErr_SetString(PyExc_OverflowError,
29727  "can't convert negative value to char");
29728  return (char) -1;
29729 }
29730 
29731 /* CheckBinaryVersion */
29732  static int __Pyx_check_binary_version(void) {
29733  char ctversion[4], rtversion[4];
29734  PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
29735  PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
29736  if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
29737  char message[200];
29738  PyOS_snprintf(message, sizeof(message),
29739  "compiletime version %s of module '%.100s' "
29740  "does not match runtime version %s",
29741  ctversion, __Pyx_MODULE_NAME, rtversion);
29742  return PyErr_WarnEx(NULL, message, 1);
29743  }
29744  return 0;
29745 }
29746 
29747 /* InitStrings */
29748  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
29749  while (t->p) {
29750  #if PY_MAJOR_VERSION < 3
29751  if (t->is_unicode) {
29752  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
29753  } else if (t->intern) {
29754  *t->p = PyString_InternFromString(t->s);
29755  } else {
29756  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
29757  }
29758  #else
29759  if (t->is_unicode | t->is_str) {
29760  if (t->intern) {
29761  *t->p = PyUnicode_InternFromString(t->s);
29762  } else if (t->encoding) {
29763  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
29764  } else {
29765  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
29766  }
29767  } else {
29768  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
29769  }
29770  #endif
29771  if (!*t->p)
29772  return -1;
29773  if (PyObject_Hash(*t->p) == -1)
29774  return -1;
29775  ++t;
29776  }
29777  return 0;
29778 }
29779 
29780 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
29781  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
29782 }
29783 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
29784  Py_ssize_t ignore;
29785  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
29786 }
29787 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29788 #if !CYTHON_PEP393_ENABLED
29789 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29790  char* defenc_c;
29791  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
29792  if (!defenc) return NULL;
29793  defenc_c = PyBytes_AS_STRING(defenc);
29794 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29795  {
29796  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
29797  char* c;
29798  for (c = defenc_c; c < end; c++) {
29799  if ((unsigned char) (*c) >= 128) {
29800  PyUnicode_AsASCIIString(o);
29801  return NULL;
29802  }
29803  }
29804  }
29805 #endif
29806  *length = PyBytes_GET_SIZE(defenc);
29807  return defenc_c;
29808 }
29809 #else
29810 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29811  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
29812 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29813  if (likely(PyUnicode_IS_ASCII(o))) {
29814  *length = PyUnicode_GET_LENGTH(o);
29815  return PyUnicode_AsUTF8(o);
29816  } else {
29817  PyUnicode_AsASCIIString(o);
29818  return NULL;
29819  }
29820 #else
29821  return PyUnicode_AsUTF8AndSize(o, length);
29822 #endif
29823 }
29824 #endif
29825 #endif
29826 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29827 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29828  if (
29829 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29830  __Pyx_sys_getdefaultencoding_not_ascii &&
29831 #endif
29832  PyUnicode_Check(o)) {
29833  return __Pyx_PyUnicode_AsStringAndSize(o, length);
29834  } else
29835 #endif
29836 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
29837  if (PyByteArray_Check(o)) {
29838  *length = PyByteArray_GET_SIZE(o);
29839  return PyByteArray_AS_STRING(o);
29840  } else
29841 #endif
29842  {
29843  char* result;
29844  int r = PyBytes_AsStringAndSize(o, &result, length);
29845  if (unlikely(r < 0)) {
29846  return NULL;
29847  } else {
29848  return result;
29849  }
29850  }
29851 }
29852 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
29853  int is_true = x == Py_True;
29854  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
29855  else return PyObject_IsTrue(x);
29856 }
29857 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
29858  int retval;
29859  if (unlikely(!x)) return -1;
29860  retval = __Pyx_PyObject_IsTrue(x);
29861  Py_DECREF(x);
29862  return retval;
29863 }
29864 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
29865 #if PY_MAJOR_VERSION >= 3
29866  if (PyLong_Check(result)) {
29867  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
29868  "__int__ returned non-int (type %.200s). "
29869  "The ability to return an instance of a strict subclass of int "
29870  "is deprecated, and may be removed in a future version of Python.",
29871  Py_TYPE(result)->tp_name)) {
29872  Py_DECREF(result);
29873  return NULL;
29874  }
29875  return result;
29876  }
29877 #endif
29878  PyErr_Format(PyExc_TypeError,
29879  "__%.4s__ returned non-%.4s (type %.200s)",
29880  type_name, type_name, Py_TYPE(result)->tp_name);
29881  Py_DECREF(result);
29882  return NULL;
29883 }
29884 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
29885 #if CYTHON_USE_TYPE_SLOTS
29886  PyNumberMethods *m;
29887 #endif
29888  const char *name = NULL;
29889  PyObject *res = NULL;
29890 #if PY_MAJOR_VERSION < 3
29891  if (likely(PyInt_Check(x) || PyLong_Check(x)))
29892 #else
29893  if (likely(PyLong_Check(x)))
29894 #endif
29895  return __Pyx_NewRef(x);
29896 #if CYTHON_USE_TYPE_SLOTS
29897  m = Py_TYPE(x)->tp_as_number;
29898  #if PY_MAJOR_VERSION < 3
29899  if (m && m->nb_int) {
29900  name = "int";
29901  res = m->nb_int(x);
29902  }
29903  else if (m && m->nb_long) {
29904  name = "long";
29905  res = m->nb_long(x);
29906  }
29907  #else
29908  if (likely(m && m->nb_int)) {
29909  name = "int";
29910  res = m->nb_int(x);
29911  }
29912  #endif
29913 #else
29914  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
29915  res = PyNumber_Int(x);
29916  }
29917 #endif
29918  if (likely(res)) {
29919 #if PY_MAJOR_VERSION < 3
29920  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
29921 #else
29922  if (unlikely(!PyLong_CheckExact(res))) {
29923 #endif
29924  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
29925  }
29926  }
29927  else if (!PyErr_Occurred()) {
29928  PyErr_SetString(PyExc_TypeError,
29929  "an integer is required");
29930  }
29931  return res;
29932 }
29933 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
29934  Py_ssize_t ival;
29935  PyObject *x;
29936 #if PY_MAJOR_VERSION < 3
29937  if (likely(PyInt_CheckExact(b))) {
29938  if (sizeof(Py_ssize_t) >= sizeof(long))
29939  return PyInt_AS_LONG(b);
29940  else
29941  return PyInt_AsSsize_t(b);
29942  }
29943 #endif
29944  if (likely(PyLong_CheckExact(b))) {
29945  #if CYTHON_USE_PYLONG_INTERNALS
29946  const digit* digits = ((PyLongObject*)b)->ob_digit;
29947  const Py_ssize_t size = Py_SIZE(b);
29948  if (likely(__Pyx_sst_abs(size) <= 1)) {
29949  ival = likely(size) ? digits[0] : 0;
29950  if (size == -1) ival = -ival;
29951  return ival;
29952  } else {
29953  switch (size) {
29954  case 2:
29955  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29956  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29957  }
29958  break;
29959  case -2:
29960  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29961  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29962  }
29963  break;
29964  case 3:
29965  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29966  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29967  }
29968  break;
29969  case -3:
29970  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29971  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29972  }
29973  break;
29974  case 4:
29975  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29976  return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29977  }
29978  break;
29979  case -4:
29980  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29981  return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29982  }
29983  break;
29984  }
29985  }
29986  #endif
29987  return PyLong_AsSsize_t(b);
29988  }
29989  x = PyNumber_Index(b);
29990  if (!x) return -1;
29991  ival = PyInt_AsSsize_t(x);
29992  Py_DECREF(x);
29993  return ival;
29994 }
29995 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
29996  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
29997 }
29998 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
29999  return PyInt_FromSize_t(ival);
30000 }
30001 
30002 
30003 #endif /* Py_PYTHON_H */
f
Double f
Definition: Headers.h:64
number
Int number
Definition: Headers.h:33
s
Double s
Definition: Headers.h:84
L
Double L
Definition: Headers.h:72
n
Int n
Definition: Headers.h:28
q
Double q
Definition: Headers.h:81
U
Double U
Definition: Headers.h:88
v
Double v
Definition: Headers.h:95
T
Double T
Definition: Headers.h:87
z
Double * z
Definition: Headers.h:49
u
Double u
Definition: Headers.h:89
c
Double c
Definition: Headers.h:54
r
Double r
Definition: Headers.h:83
pos
double pos(double a)
Definition: testFMMandFSW.cpp:8